我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! v0 ~0 \5 n1 F2 j! Y4 O( Pimport swarm.Globals;$ p8 Z3 j2 e) ?
8 l, B+ `! f8 V2 x8 {8 f6 U7 ~5 Dpublic class test {1 T0 l: C( H$ A- f0 C3 p
/**
* ]$ r" c0 {8 c* _8 `8 t3 H4 B * @param args
! X$ E( `3 F, T- F0 ]( K( ?7 F */
$ [: S# d6 x/ z% P- O9 Q- V public static void main(String[] args) {
. k4 P5 q h: K V- \5 e/ Y ; |/ ?. ]7 W! c# {2 ?5 V
int y=(int)(10*Math.random());
& {/ V- K' n6 L9 H System.out.println("result is "+y);' @ ~4 z% U" c
! j" A4 R' d) R1 G/ M- m8 s0 ~ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
& V8 A9 S; v, x; j System.out.print(z+" re");! l; e/ z$ I$ G3 V
}" w% e3 m( `: @/ X; C' W1 b, h% X. Q
}
u0 Z% W7 [! `$ x$ K Y7 q+ K4 U) L( X# R3 d' q1 F
结果是:, X0 M; i0 i; p/ T' S& B! e
result is 2
: |9 I9 @! d( k#
2 R4 G+ ^4 I F3 p9 J1 U- @# An unexpected error has been detected by Java Runtime Environment:
: C8 @" j" o; r3 G9 G% u#/ _0 i% k$ ^! d
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068; I$ q* T/ \: Z, }
#
! P$ b% g1 Z6 L1 n# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ i$ n0 d+ P8 a4 ]& Q# Problematic frame:( b \3 h: ^, x
# C [javaswarm.dll+0xb8305]
7 S2 {. g; A. x2 f#
* G5 ^2 n# h4 V0 m+ ~5 g9 \# An error report file with more information is saved as hs_err_pid1064.log |