我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。# a6 a' c6 M7 q/ y% F
import swarm.Globals;* g+ H+ m* n) y7 q, H+ ^# e
. O) U" f `4 Z i: H0 l# L5 Ipublic class test {
% o. m+ S; U' m# K0 S /*** D1 R* k7 a- `! C. X( ~; ^$ T
* @param args% \% t9 V" N4 e0 |6 E( g( _
*/
7 O7 J$ N3 ~0 E- Q% V public static void main(String[] args) {0 c* F4 k+ Q+ T' z& e
" m1 W- n: o2 K/ I( w7 ] int y=(int)(10*Math.random());( O D+ s ?- X( z( j) A# ]
System.out.println("result is "+y);; S; Q" G c1 ?. s7 E$ f
j( f+ i$ ^: J3 ?4 ^" B9 Y5 z! L double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 Y* A* j7 c+ n# v" @) T% r. D5 Y
System.out.print(z+" re");3 {; ?/ w+ P) b, i" K" O8 ]
}7 s2 l& {2 C# s. _
}- c3 ~# S+ `7 b) u% S% n* E9 j, v7 b
1 A+ j+ Q; K$ B- y o% [
结果是:
+ O. I! _( l [7 ~7 Y9 D, q/ Nresult is 2
: A3 ?& ~; v7 }/ y( o2 c& Q#) @& b1 D& j: f, [7 N
# An unexpected error has been detected by Java Runtime Environment:( K% u h- M* K# B9 {0 t8 P: k# o
#5 F5 u5 d* f3 @2 W5 n8 a x
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 \* L, d# H0 r4 w' q
#( |& e% i* b# H
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ I- Y6 q5 G4 R. @8 i0 ?
# Problematic frame:) e% H* x# n* q
# C [javaswarm.dll+0xb8305]7 C0 c; X% |; n) M, J% s
#3 f8 W7 z" `- m: a
# An error report file with more information is saved as hs_err_pid1064.log |