我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 J; _2 {% {: R1 L; Rimport swarm.Globals;
, X, Y2 W3 h) m @+ n) a+ n& }8 A) ^6 o' Y' Y! B- }$ U" t
public class test {5 V5 s0 K8 I9 s2 n8 u3 {5 s5 R# D
/*** b) q# z7 G: i+ k1 }1 `
* @param args( r1 T8 ^) O+ ^$ `
*/
- ?% t7 c R3 X- L; s* y public static void main(String[] args) {; M6 g3 u# N {5 O; \: W
" m, q5 s9 J H* B' u6 T1 v+ g5 D
int y=(int)(10*Math.random());
/ ]4 _( {: t4 k( k6 X1 e7 I System.out.println("result is "+y);: ^ }' ]8 T8 W2 r6 _$ }
# q. a# S# ~3 u. E# u double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 y( a* r! W! B System.out.print(z+" re");
- o4 l8 t0 U+ c0 d1 ]& T' X }
& I0 j2 E- W- H' j# v' }' Q}
" I& r: Z H2 J; L- o' r
1 o6 J9 X$ l) y, k& {3 o( R* n) _结果是:
4 _; a/ C+ q4 W: r( V2 Gresult is 29 Q, s: o6 p1 @8 Z% S
#; m- X# P7 W5 F2 Y4 |
# An unexpected error has been detected by Java Runtime Environment:% U9 R+ V$ I" |- s* I0 I# t
#
2 ] c- z) k" b; g# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10684 z. F) S$ l' o+ L' m) k5 M% c0 G
#
. X- O, K: O4 p. o- E1 {/ O# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" J4 L* c! V9 u& c; e5 r# Problematic frame:/ M9 w, |, w1 \& z
# C [javaswarm.dll+0xb8305]
' S7 U; ?+ i6 Y9 s7 a& z' H#
- Y& R3 L4 w5 R& d+ |. [# An error report file with more information is saved as hs_err_pid1064.log |