我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。0 P" {5 f$ \. L, B
import swarm.Globals;! O, C( B$ `3 y/ J# w4 Y0 o0 v4 k/ b0 v
; ? l7 A6 _* O8 H& f. @. p. O
public class test {
$ T1 q, i2 n/ N2 X0 y /*** H- |1 J9 p6 O$ C+ {
* @param args X* u1 v2 b6 x. I/ c/ G8 ~6 a
*/) Q0 ]- w4 W4 i, \; S) @
public static void main(String[] args) {7 n2 p+ Z& A. C) f
- g# S" r9 A# l+ \/ s M! Y int y=(int)(10*Math.random());0 }3 t* W# R3 j" b! g9 `% n8 ]4 @8 c1 W
System.out.println("result is "+y);8 t2 ~; k. K. P* D0 K* z- f" N* Q
8 b8 R/ v- u# L9 T' R double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
' ] r! e+ }2 S9 K8 Y7 Y8 k System.out.print(z+" re");
3 |; d+ x. y, W/ E/ G' p }
, `. _1 ^+ `* {# W}
7 q/ p3 Q/ I! [; ]/ R" F( I' Z
4 `& B; e P9 H0 a! r结果是:4 p% e/ K$ E% z; ?- h# \+ W
result is 2
8 A" _' I/ D( E: s+ ?#0 E: U# M( O; m# ?
# An unexpected error has been detected by Java Runtime Environment:/ y! E/ H4 _% q' |) r- f" R
#
+ q# ^- x% ]! U# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
* F5 f5 T% ^, u2 m1 P#
1 o3 r0 o2 J( }; c, b! b# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- s1 `' j, f& R' A9 T; d1 f# Problematic frame: S% U0 c( c& m. j+ O- {& y6 z
# C [javaswarm.dll+0xb8305]
9 {* |& O( T) G/ C- J#/ g) \" a7 _& c8 r6 y! [) j) m4 E
# An error report file with more information is saved as hs_err_pid1064.log |