我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
4 x2 J X* l% ^" X- q* _; |6 w8 Cimport swarm.Globals;4 t# G5 [/ L7 ~& ]" k, b4 p2 K
9 s0 m5 D+ k9 `9 }. @5 upublic class test {0 c# Q. B' Z$ j, G* B; g6 v
/**
+ R# \1 O5 d" I6 X Q& k ~; w+ v; z * @param args
, f% w1 F; h; i8 l( } */$ Q. H# j! o. n& F% j" A$ C5 @/ _1 Q
public static void main(String[] args) {% M3 b% M) P1 n/ l8 S f" k+ m' v
4 {; ]+ r2 z+ S# S9 G
int y=(int)(10*Math.random());5 E, F* ]& \: w* I
System.out.println("result is "+y);
* E& U' y! o5 l; I: S- D
& U0 X- d0 y$ f double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);! |% A: K5 P& m; I
System.out.print(z+" re");+ o$ v* s9 [5 V7 a. u
}; c4 Y& T1 P; R' r& S
}) Q9 C, ^& U1 K6 f
, y. s& a. M4 \( n6 d3 x5 c- T结果是:
l0 _& O* E2 r; u6 O9 x. P$ Cresult is 22 O# d; i0 |/ a. \( c: ~
#; w$ r" ]) g) U0 p0 j( W
# An unexpected error has been detected by Java Runtime Environment:* w/ l' y5 i# S& \* E) T. T
#
* Z9 M3 P' E( s8 K# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
3 m4 k! D) f' \6 y7 o#; t5 z+ ?. `* N" ^+ f; V0 F
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 m5 D3 \& f' ~" G m0 r1 e4 P- [/ j
# Problematic frame:
; F7 J: m) J9 _' q5 p6 v9 U. D# C [javaswarm.dll+0xb8305]5 p) g7 W. Q/ n8 q0 M8 ~
#
4 h' E) S' o& R/ }5 d+ q# An error report file with more information is saved as hs_err_pid1064.log |