我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: i6 {9 w# T. rimport swarm.Globals;
/ H$ S7 f i; _ D
' m$ _1 F' H/ @2 S7 I2 D; Ipublic class test {/ S% t7 p; @- {
/**9 f6 O6 i+ n' q
* @param args
6 V5 ?5 N9 _3 d4 s2 f */
! T6 t ~) ?& s5 Y public static void main(String[] args) {
# K# x s$ ?+ L, L% v: F & |- T) e7 x' a2 R
int y=(int)(10*Math.random());9 h2 v# z6 M' Z( F0 R: u9 k
System.out.println("result is "+y);* b+ @6 \3 o' A( ^0 F# k# d
q" Z7 S/ c, @ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
' n: P0 n2 I7 w4 n# T [2 r System.out.print(z+" re");1 r0 ?! S# e' G! @
}
) O% T. O6 {- ^/ ?0 q* `}
5 H5 Q% E. S2 c z. x* I1 ]* o' f7 n/ P5 u2 u, n+ Q
结果是:1 R2 w l1 E* l/ ?5 W$ g" N
result is 2
+ _$ A$ Q5 v) D1 {#0 t5 O9 o: S4 _' N2 D% E
# An unexpected error has been detected by Java Runtime Environment:) G2 j/ E j: P6 q7 y/ V
#
- t1 Z- s3 ? ]0 c, |& y* K# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: @% X2 }; ?4 k% \+ i$ D( `8 r$ M#1 _; S* ?6 Y; ]+ q
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
* O* p" l; Q2 Y/ ?7 o+ [1 t# Problematic frame:
* m. T% f. {+ p# W: C3 S7 P* u# C [javaswarm.dll+0xb8305]3 P* P1 g# G6 E9 L, f' r' k
#% K4 }/ G4 X- y0 G, i( q& C8 u
# An error report file with more information is saved as hs_err_pid1064.log |