我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
h0 S6 c0 \, G" Wimport swarm.Globals;* W7 B/ \( l+ l6 |& c4 B
# L1 \; P7 e0 F+ z+ f# k9 V: i" u- cpublic class test {9 q1 [+ |: R) e1 ~; r
/**
6 Z* R; ~5 U* ~% s0 p% [ * @param args/ i S) r2 X+ @9 y' T
*/
1 G; R6 F- x2 C1 E) d0 m public static void main(String[] args) {/ x$ T' j1 O8 w5 s0 n/ Q! k. s* c
9 Z- e- m+ V: S$ t' D, s
int y=(int)(10*Math.random());/ k' `) t+ b) B J
System.out.println("result is "+y);
( ]" u7 k2 m- D, W% ~0 j1 ?+ b$ K1 ]/ x
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 B2 I" F; e2 {- x, z, N- |( E
System.out.print(z+" re");# o0 O' L( y- w' z0 P
} l$ q) r2 q9 L7 \/ p/ _0 _/ U5 L) G
}, I* _9 G: ?& n) a
4 S+ Y7 I2 L( V9 j7 w* W+ a结果是:
" J4 S A% `2 H# X. jresult is 2
7 O) V9 ~& N4 N* k- y" T#
N/ k% ]! ^, C4 X( V7 L3 t# An unexpected error has been detected by Java Runtime Environment:
% @# l$ K8 v2 b#8 i/ }7 n, f8 g- \ E5 y' }% M
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
; v6 ]; Q7 Z8 ^% O#
9 w$ G" w2 D M+ C# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
: e7 d% L/ `) F2 N, Z% h# Problematic frame:
. I, p8 h: U1 D* K& c5 x% c$ A# C [javaswarm.dll+0xb8305]
0 p. j5 I! k( N#( ?+ ]" ~4 D6 \% p, d) G( e2 y
# An error report file with more information is saved as hs_err_pid1064.log |