我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 P* ?" S3 J ?% [! J8 o0 @5 \" ~import swarm.Globals;
9 W: U5 q, {: G8 U9 e6 P2 o9 d- b
% A9 n! f' ~1 k4 `$ W( E1 ppublic class test {
( ?8 q+ B+ w5 k" z' Z0 y( _ /**2 w9 b l1 E& O2 G- d& j0 K3 C6 t
* @param args
* R$ \2 ~: y, X */
8 y1 y6 ]7 a- I) J9 ^7 X public static void main(String[] args) {0 [0 i+ f. ]6 C6 X
) Y& U c# A7 p) W int y=(int)(10*Math.random());
) v( I8 _6 ?0 h. m) y- { System.out.println("result is "+y);/ e% I1 k) L: Y/ T) X9 b; d
- G# H- b3 u3 j2 e
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) g( |( H& t" S+ A" f System.out.print(z+" re"); w4 y8 J8 j# s, H5 f7 \
}# F8 \9 |9 m# r5 H0 p
}4 n& B. @0 V3 M+ F$ x8 o ^( U
; n' V5 z% U! f! H9 m结果是:
5 M2 d% w) s! a8 C# C+ Fresult is 2
$ |# f' y6 C4 T2 A. ~#; I8 \/ g+ s d. h# G" ?$ N. F
# An unexpected error has been detected by Java Runtime Environment:
5 l1 ^' H. k- F, P4 g) u. G#
. D4 b5 o" s% H4 s# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
- S9 M. [7 z( _0 u; H0 O1 O#
2 f! H' a% S/ s1 V Z# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)- ^, Y8 J( ]4 H: e
# Problematic frame:
: R! P8 z1 Z7 D; [# C [javaswarm.dll+0xb8305]3 ~2 _- Q/ ^& F& r+ F- c) h- s
#" N: ?, J3 l1 W+ _2 w, I" |
# An error report file with more information is saved as hs_err_pid1064.log |