我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。- z' g( U* D& m! B- t/ Z p N
import swarm.Globals;) `$ b, u x8 B b3 p
4 F: i, n; |* v) z+ K; dpublic class test {
: P4 D; f" _8 k7 ?- m& B /**
4 F) L1 T2 W+ B * @param args% M0 r" z2 ~; y* p: \+ I$ c
*/ j1 L+ R5 m* D; L& Y- N; c
public static void main(String[] args) {5 B* n8 X/ N( P4 d
# h- X2 _# u2 Z3 d9 ~& N, l int y=(int)(10*Math.random());
; v) F9 ]5 P9 ]5 j9 E6 v& K System.out.println("result is "+y);
% E) c" C. `+ b, W! P4 z- T! P( O7 y1 }+ n( A+ P ]
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);- ^# ~. `6 |% S6 r% ?, u
System.out.print(z+" re");# w3 z4 }: T& W( q" D* W# M$ j7 D
}
! r1 l2 [9 w# K8 A! N/ w# L}) {' R' ~8 G7 m3 e) _7 Y) ?
/ ~! a4 H( |% w- q
结果是:6 I7 P( Y& v3 `& x; _6 N; s/ s# s6 a% E( e
result is 2
1 b* F% p. G2 |! J## }# @- c) B! g4 [3 ]
# An unexpected error has been detected by Java Runtime Environment:5 C/ J9 |: {% {7 W, I; B
#
, @2 k( i" h, \2 }# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* U& Y/ Z; N! N" j* a1 x0 q
#; Y* p! f1 K$ a* G: g
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)+ V- K) A0 x9 E/ e n
# Problematic frame:
! o3 e! Y/ T- b+ f8 Y8 k# C [javaswarm.dll+0xb8305]
( L1 r( M4 U# K* e6 J#* N: p' _" c7 k/ @7 u9 c) l2 r9 j
# An error report file with more information is saved as hs_err_pid1064.log |