我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 t2 @4 D" S+ z3 |5 o, `0 V# }import swarm.Globals;: t! }- v/ h, ~' T: _* P
# I" [3 @2 F* o- j! K! v) | \6 Epublic class test {
1 I3 {, w( O# ~ /**
, j# x) r3 L! c+ Z3 v$ r% U3 s2 B/ F * @param args
$ b/ A2 G4 ?, n* W0 P3 j1 @ */
Z8 v+ }9 f( d; k0 \ public static void main(String[] args) {
* j9 h; H6 x4 c0 S5 P* L$ {% i # ~# N, q& R# ~7 s) f1 G3 L
int y=(int)(10*Math.random());
$ b# h6 r' w. K4 f5 W& q y System.out.println("result is "+y);- v5 p9 Q1 N; S) K; X
& R/ ~3 z; @# V( s& g double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) D6 U/ g+ n! v5 n% s System.out.print(z+" re");, N! n3 Z. |! L* L6 u* w0 d6 E) @
}: Y8 I+ ~& K- A C& C
}: q- \; c5 s1 e- Q' Y& p
4 r3 b; K( _2 S, [1 b" F M0 n结果是:* o! d# G9 I& M- o
result is 2
" f7 F7 t& v5 y#
$ C. t+ b; d5 X2 v. ]* z# An unexpected error has been detected by Java Runtime Environment:! B5 }' \' m9 P8 W" x* O! ]
#
. q& c# G9 Z$ p7 N) V% b+ q5 P7 p- \# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
4 v$ L! N9 M( J8 E- g#% N& n9 U p" p5 Z" P, ]0 V7 I5 b
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 v3 H5 @, d! z. \1 I5 @
# Problematic frame:$ G& }% k( e' r" {5 |
# C [javaswarm.dll+0xb8305]( I9 d% U) m W8 y/ t/ ~, ?
#" E4 W: A" X. `4 Y% a$ M
# An error report file with more information is saved as hs_err_pid1064.log |