我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
2 k! k. s5 r. E6 Simport swarm.Globals;
7 y* a6 D8 ~# }; k
0 k1 T" d. H' d7 @0 Zpublic class test {: W( I+ N8 ^7 I" G# ]. z8 ]
/**
0 s& \3 g4 N+ y% ?1 Z * @param args+ ?3 o' o7 C* x+ A
*/
; C2 ~& {5 I) ^/ |$ Z- Q' P public static void main(String[] args) {* Q9 \4 V* s- W2 v, I; m9 M
3 z9 Y1 A0 i% z8 ^+ d5 }
int y=(int)(10*Math.random());
0 ?, x' N, L1 Y2 |6 a9 M% o ? System.out.println("result is "+y);
* [( Z% E7 Y- [1 v) N* Q: W
3 `4 e0 R. }) ^ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);# ^ w; |+ d9 E; U0 _
System.out.print(z+" re");
+ I5 z; X) o# U9 S) N! e }1 w0 h7 }3 f% E4 `# v
}4 p4 H/ x) v" `4 V
& j9 J6 {7 q+ l' A, ]7 J7 d/ L结果是:
- I' x) @% G1 w9 j5 R3 j% \; C$ Vresult is 2# H$ I2 o/ I2 n
#
6 X. Q6 X8 ?- S1 T# An unexpected error has been detected by Java Runtime Environment:
- r% w/ c6 Z5 l1 ^4 I# a- w* f; W4 s& [8 ^2 Z: W+ `! P& w% n0 W
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
& P Y: D# N- P4 s& g) o#
( d* k( P& b$ [# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)- H. n/ P. I; v) @9 r# n
# Problematic frame:* c8 ~8 x! X6 b: N
# C [javaswarm.dll+0xb8305]
2 x4 e( I4 t+ J4 V/ K8 u#2 _9 S/ {7 M% ?0 {( c" s+ T
# An error report file with more information is saved as hs_err_pid1064.log |