我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ f7 d3 K- s! d1 m# aimport swarm.Globals;! f8 J4 j/ N8 s( S# G
% K! r4 e* }, Z' K' |public class test {, v# c! ^: a+ t% i6 u8 G
/**0 _3 M9 p- F7 F1 B( l" F
* @param args& R0 ]. S5 H7 N; l6 H
*/2 w# F. ]! ]/ r. ^
public static void main(String[] args) {1 ?4 k, J: ?' q! U8 D
! C9 D; o( e6 E( L2 Y
int y=(int)(10*Math.random());( I4 U8 _# l" r. a) t2 U5 v
System.out.println("result is "+y);- s7 r! f! B5 |( c; G
( Y6 [) N# h" Z/ ` e4 q+ C
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
/ Q: B4 {: u7 T/ t" L" ^ System.out.print(z+" re");
" D- P% I0 X: ]! T0 |/ Z3 [8 z }
% r- |' E" S% J6 H K4 V& z4 R}
+ Q7 Z) T, D) ?. L* ?6 S4 ^8 V' y4 E$ ~3 I8 }2 j/ \
结果是:6 c9 s1 B8 L1 ^' s- j7 N4 t3 [1 J
result is 2, g; |, a6 R) d$ G) ^
#* v. h/ E1 T- }& \; W
# An unexpected error has been detected by Java Runtime Environment:
4 B5 ?. V/ ], f( c& p$ @9 Y6 J#
0 B) a7 @9 }" j# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( ]) V3 T& |2 q Y" m ~2 k- r1 k#
; I% s0 |; C9 ?$ S7 t# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
! k" K9 m; u2 J% a4 w& O' |# Problematic frame:
/ y; `$ S4 U) D! y* P# C [javaswarm.dll+0xb8305]! g! w! C+ h0 \/ ]7 g9 a
#
3 @3 I3 T+ ~% Z7 @# An error report file with more information is saved as hs_err_pid1064.log |