我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 m. ~8 c( U% P$ {) Dimport swarm.Globals;
8 N! G" c* V+ C8 G+ l3 I
+ ^% R k9 N2 R% L, Vpublic class test {- M M+ n4 \) H0 z. F9 U. S; _
/**
; _& W& k) }4 j0 R! t * @param args9 h" i3 S# |9 ^& i
*/
# a" y( t9 P% O9 ] public static void main(String[] args) {( e- P/ B0 c" Z9 x# n
' P N9 l" w* f! A9 o2 I
int y=(int)(10*Math.random());
2 A" e7 B2 U) G: T/ k7 N System.out.println("result is "+y);7 V6 M) m. F/ d+ i) H
2 s8 \6 f4 ~8 Q8 A# w
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);9 s: m- b# G$ G/ F
System.out.print(z+" re");3 T- V( f9 S; R; h8 r
}
6 z) w& s2 ]) o9 O" C# x5 M}
# z7 K5 Y# M0 W" w% Z* q7 h3 p/ O" S `
结果是:. E1 D& }7 U. e2 [4 a5 Y3 e: r$ W
result is 2
, C& l0 Q/ q: L6 K& h; N ]#
S4 B' S, \: l6 k5 H8 h# An unexpected error has been detected by Java Runtime Environment:
N& O1 P/ _9 m; ^9 U+ d. A% K#
* Z$ W% q- I. o+ C5 K) N" [6 B# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
& ?7 T. P6 G U; d#$ T* ^+ K0 P8 s5 `0 |& ?5 s4 k
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
( t8 V, p, A) X5 T/ w# Problematic frame:- q I( d' d9 Q( B* f
# C [javaswarm.dll+0xb8305]
9 k! w( i, i/ h- L#8 E) X, u- M: q, W
# An error report file with more information is saved as hs_err_pid1064.log |