我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
) h3 e& i1 V1 x" U/ eimport swarm.Globals;7 ^ C. T) [) |6 Y6 A
! z+ ~) G8 N! h2 v0 cpublic class test {
: d$ V% Q, P, N8 n T /**
5 ^' W; ~1 A! r% M: A * @param args
8 `# P% r6 }7 f& v1 I */3 g- I2 }: `5 |' F' Y. C3 D
public static void main(String[] args) {# z4 }4 s/ _5 \$ K
9 G4 C6 G9 S% g$ p4 h: D) t, s- w- i int y=(int)(10*Math.random());9 ]& z$ T) o, g+ Q6 s
System.out.println("result is "+y);
" }- c) A; o! Z j' p+ G! }' w+ r% t3 L& }- w. _! @# B
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 Q9 W1 Z- u4 ^4 E, u" _" P System.out.print(z+" re");, A5 o! \' m+ h
}
3 y3 B% V7 K8 M& ?% ^( p}. N0 N3 |) o1 [7 \( P
0 w F e& I* H$ c4 b
结果是:
. w! @& o! ~- Q. f9 ~$ [$ Sresult is 2: M F. d: m' q& z9 K
#
/ Q/ t/ h/ \6 k' a* D; Y# An unexpected error has been detected by Java Runtime Environment:
% {6 Q+ f: \" \( C#$ `) s5 u, Y& e
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10685 T1 I, b; S. C! d
#
' [4 \; b/ d9 k' R# w# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 X8 }0 S, Q1 N* ^) v& S6 r
# Problematic frame:
# w' {6 e$ v3 p& W/ }; S# C [javaswarm.dll+0xb8305]
2 O) M _- ?5 ?0 i. ~5 ^% v#
6 b2 m, }, }- w6 W# An error report file with more information is saved as hs_err_pid1064.log |