我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 o4 a8 w5 ~2 ]/ [( y5 `import swarm.Globals;7 y3 |8 P% \+ e
, r3 o+ r" m( T% F5 z+ N# A+ Y$ F
public class test {) Z0 a j: [' O- ^
/**
, k R8 a( ?3 \+ w& H% ]) o: l * @param args
/ n' f5 l* p; @2 m! u */$ Y/ i6 N7 o! z
public static void main(String[] args) {; b3 f0 y6 m1 Y$ M
9 L% i" S b- ]! ~8 V int y=(int)(10*Math.random());& _9 ]/ O7 G7 y; d- J
System.out.println("result is "+y);( t* w0 e$ O& o, x: {7 F+ e
$ q |. H$ j6 {$ j
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);! t" V/ r) }$ V2 S& Z$ b" C0 \6 c1 o
System.out.print(z+" re");
) s4 J8 g- S. M3 I- F1 H9 c; D1 o }
! B4 ~9 e t( k: ^, b9 P3 N' D}
4 y5 X' i9 e7 v7 j( r( n3 c
1 m1 ~$ A2 {2 h; ^2 g' E4 w& g) @结果是:
8 K: {1 @1 E# m, B3 Zresult is 2! ~1 r0 F# o* K: V9 g' `3 y# \
#
- |/ f; m( q4 N' p4 s2 c! G# An unexpected error has been detected by Java Runtime Environment:
& `) o: ?3 a+ U/ G8 F# N0 @0 x#
( O: m5 u# Y0 F& b$ N D# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: e4 r8 }; D) [* J7 g5 A3 [#
( [5 _ _; ]- q7 h# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
v: p7 @6 w& {/ _; \6 G# Problematic frame:: \/ j. j* r. |( g; g
# C [javaswarm.dll+0xb8305]
- i" C1 W! D' e8 O6 L* F7 x# X#' U P) F9 O* T0 ?( c! H8 a) V
# An error report file with more information is saved as hs_err_pid1064.log |