我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
T4 U* @; K9 ~8 I2 ?import swarm.Globals;' S% U) F. Z& D! J( G
- E- \% F/ u9 n/ ^( G2 n3 E
public class test {
) n( H `, l" S' q" ^/ ^2 e9 u. o! u /**) r5 P& n: ~) x E
* @param args, R. U/ _: ~; P( N5 |( a( E
*/" j) k1 z5 U' ]* x Y9 K
public static void main(String[] args) {/ Y7 A6 ?& I8 f9 ~1 [
4 w/ M/ A+ \) A2 ~2 L7 U
int y=(int)(10*Math.random());* p& \1 A* k$ c* J( g
System.out.println("result is "+y);, q" w3 x- d/ ^2 I/ ~
m( s; y4 f( z8 D; ]4 A1 n
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 N4 e; N4 J3 a5 h
System.out.print(z+" re");
* q o' |1 w L. I) A: I }/ C% ?; P i/ [2 U& H9 s
}
# E3 @) B6 {/ Z9 y) \
4 j+ Q- J9 A( f& N, a- x2 E7 _* |结果是:- G; f/ A! \! `6 t0 E0 ?
result is 2+ l' u' L. u6 \5 d# \1 k3 p
#2 h7 _+ }5 q9 N1 n# d% }3 x
# An unexpected error has been detected by Java Runtime Environment:8 v$ j# g7 ^- U8 a" |& Y' ~& r3 j
#
+ i9 I& k, o2 Q5 l" D# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
+ h4 W, ]/ o, f* }9 ~6 e8 t9 h#% s& R; T' ?8 I& o9 [' W. N+ x( K
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
; o9 z2 C- }, s# Problematic frame:
; G+ B2 _7 Q6 p* b3 ^5 M# C [javaswarm.dll+0xb8305]' Y: K6 o$ p4 O0 [. y
#$ Z' p1 z6 w5 O5 t. J, b" o9 Q! c% b
# An error report file with more information is saved as hs_err_pid1064.log |