我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 r Y* }! j- Z1 e Q1 kimport swarm.Globals;# u/ f; T. C6 \1 c
$ Z9 f* K5 y/ U( Tpublic class test {
. u" M5 A3 @; e /**
4 |5 T+ m, F5 O, a * @param args
2 \ b8 E/ S$ t$ l; ~ */" H0 Q( M# M H# y e! D
public static void main(String[] args) {9 m1 @" z( x# Z) Q' e# N k/ c
+ |; A6 p3 a% Q% F/ W
int y=(int)(10*Math.random());
2 I+ ^+ P. ~+ @( v3 E System.out.println("result is "+y);; a! b ?8 X; {6 x k6 C0 ]
6 d2 Q0 V$ R7 W; S4 ?3 F2 W w1 w
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
. P# A( c2 t+ w( f System.out.print(z+" re");4 }2 t, Z# u7 h& Q Q W5 n
}. n2 }% C7 b: u; L( ~& h9 b/ {
}
_ u. v" z) {& i# G% z
3 V/ u6 Z/ Q2 n8 V8 p结果是:: y- L/ ^/ F9 M: n- t! G+ b" B% ]( g
result is 2
, }/ d- ?6 s$ f3 Y6 R#
) } }% w& T) U% e# An unexpected error has been detected by Java Runtime Environment:
/ k1 M& N5 a! I- k" E) m" E/ r#
# G" ~# q: I2 o0 v; C! g+ _# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068 b0 k6 j. n8 D9 ^9 e
#, D! N# m, n) s4 k" V3 I# f
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 f5 I/ e) M" e0 K8 W
# Problematic frame:
6 D5 ~. x0 p! F# C [javaswarm.dll+0xb8305]' H+ ]4 o T& H4 B3 O
#; W4 R8 J, k/ u0 Q- p8 ?
# An error report file with more information is saved as hs_err_pid1064.log |