我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
' D% ]; w4 i6 [; Rimport swarm.Globals;
. [) g" D: q% S' f
8 t4 {6 B. \1 _( upublic class test {! D/ o) d- v# c& [% X* I
/**
' x' b' k- r1 x2 F * @param args
3 Q! c% Z4 Y4 m& j */' n% ?* J. m1 ]1 n/ m
public static void main(String[] args) {1 n% t, c; U& P8 {
" ?* I Y% d F. l int y=(int)(10*Math.random());
+ |8 Y6 X) l B$ F. L System.out.println("result is "+y);% d& M/ o# [+ o. Q: V! H* f3 f
4 E" r' d6 j: p( ~' ?% I% ^* S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);# U6 o9 Z6 y- r/ W
System.out.print(z+" re");
! o' ~9 l7 ~- [+ O* M' c/ `" P }
' f! y& J& ] S% @1 v1 t9 A}4 H, t8 E! E; M, x
& P( u6 {2 e! x6 ?7 P
结果是:0 I6 B" j% S9 |; T
result is 2
1 `3 r5 A$ }0 j) q3 X#
T3 h2 M; N" A5 ?+ s# An unexpected error has been detected by Java Runtime Environment:
. M- `/ k% X' |$ K( d/ r( U- \#
2 V3 p) }& F, f' d# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10688 `$ V# L1 F' ]3 h" j {' x- U
#
2 h; @0 X) A! g! }& ?# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 ?5 J, v. C# c
# Problematic frame:& p! W' ]6 @( o3 H" u
# C [javaswarm.dll+0xb8305]
1 X% i" f5 }' F+ b( C#* m8 I: i6 a. p. t
# An error report file with more information is saved as hs_err_pid1064.log |