我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
9 C8 r7 p E7 `, _3 W7 f# qimport swarm.Globals;9 A% Z9 t7 }: [) f
- {' i. D& J- Z6 apublic class test {
* F3 `. L3 q \5 Q /**
7 ~2 y/ M7 f8 L/ t' { * @param args, Q+ H/ X; m% ]/ _
*/8 U2 M. h: P8 p" Q8 e* _6 O8 I
public static void main(String[] args) {/ ?# _$ K5 K! v" L, ^/ G! m, C; U
: @& k! b& D9 n* U
int y=(int)(10*Math.random());
- W+ Z4 p2 ]$ C System.out.println("result is "+y);3 t3 A% ]' j( Q
( Z7 J% L3 ?6 `* D
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
2 x$ _* b5 L; b- K* {& e System.out.print(z+" re");' {$ F: y% ^' O- ~4 v
}
, ^5 T: v+ W2 a* D7 c6 h}
) {( D( [, E) @1 M# r6 R, z9 h, I1 |
结果是:4 x/ h+ w: U; I; j, Q
result is 2$ y5 |5 n" ^. ^+ A& T5 R, ~
#* Y4 O! G" G* _
# An unexpected error has been detected by Java Runtime Environment:
) I j( y$ \8 O( V& G# m#
# L7 s! g& `; Z& q, A2 O/ c% {! d# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( m, f8 l" n0 v# M#" @% T! N3 m6 U3 S3 w; k
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)" M' @7 W! y& F
# Problematic frame:
0 ?% o6 M t" S& A# C [javaswarm.dll+0xb8305]/ s4 D- }& J1 o0 ~7 _6 m
#( c8 a" J+ y* A; L7 {9 R
# An error report file with more information is saved as hs_err_pid1064.log |