我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。 U& j0 m9 T' }- p$ r( n
import swarm.Globals;
2 h5 y v: b- A) @- S! @) q' u% P
, V3 E( m! q: T$ r" ~public class test {1 W* _9 ^- @/ Q/ I3 K1 ~) |
/**
' c3 @, J* u- `- H * @param args
8 P. j- x* m+ q2 v: b3 `5 H */7 J; L6 A Q$ v8 Y& V
public static void main(String[] args) {# A' ?5 _3 o/ ?6 s5 E7 p
) ?/ y1 y) ^2 D int y=(int)(10*Math.random());
% ^" }: X# x5 M2 k System.out.println("result is "+y);
1 R: P/ r: p$ p- l: ]& B; L4 y
9 ?. n" t4 \; p" w6 n double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
4 l" Z$ Z& j6 B9 a+ c" I( o! | System.out.print(z+" re");$ M D" |# ?9 t: Y: O
}
. Q+ ^6 R5 q C2 u% T9 V9 {5 d}- x7 a" z9 k3 [% y) N, r) e6 G( w
+ `; W8 D. ~& W( w0 m3 y
结果是:/ J, f' e( I- P
result is 2 Q1 a. [* G- D! I
#
! T, b' W8 A; l6 \+ F, s# An unexpected error has been detected by Java Runtime Environment:
% H Q' j5 H+ m: T#$ z& L3 Y) l m W9 u
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
) P) L t5 Q/ H#
# b" g& R9 Q; l9 w9 i# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)4 g0 I9 b+ S7 G" L
# Problematic frame:
9 E5 D9 P5 v$ I9 m, M# C [javaswarm.dll+0xb8305]
! R; j! u( l- w#
9 \7 i4 d Y2 Q& m# An error report file with more information is saved as hs_err_pid1064.log |