我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。* |- B2 G* {+ f: G* ^
import swarm.Globals;- {% ~; b. A7 B; v* `, I$ z
+ L# k0 x/ f: C7 u
public class test {0 g3 Y& S, k; l) D
/**( R9 B' G: B0 \: q' }8 y
* @param args( t. n4 e. M4 i: K! Y2 w4 s* ~
*/
! w% |* u( g4 m) i public static void main(String[] args) {0 L/ [3 E% u% L4 ?6 j( ]
( c# A% q9 Q+ ~9 j( _
int y=(int)(10*Math.random());( i o: {6 y8 I$ X) o
System.out.println("result is "+y);; g, F+ K9 L% v
" g* S& b& |# q+ s double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 H* k8 m3 b9 \' w: \; n+ g System.out.print(z+" re");' b2 W1 [ I% u
}! S* J# V" c9 N+ B4 }
}
6 I6 H; ~! v$ [: j
8 @5 U0 Y$ L$ M0 Q" b结果是:
. U. M0 U5 l7 Uresult is 2
6 y2 `3 b* u: V#. E5 @ Y& _! ^$ L; l
# An unexpected error has been detected by Java Runtime Environment:
* g2 ?* T/ B! z% A9 }1 u: d#, Z* l z( ~3 J9 Z+ N
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 w, ]" |6 p2 s% W
#
/ k: k: w& J% P, i3 g6 P# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ B( Y' [4 N9 ~" _# Problematic frame:
! B6 ]0 W$ {/ `& Z# C [javaswarm.dll+0xb8305]# s2 A; w3 s# ]6 Y
#
9 m, ], K) V! X6 o8 @' }: V: n# An error report file with more information is saved as hs_err_pid1064.log |