我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 h" a G! R% m5 N' x7 s. gimport swarm.Globals; U4 T8 u3 p) F3 y$ v
( C+ {; U/ z% Y) L# G+ s ?
public class test {) h- q( a4 {3 p7 r1 X; f* g2 D
/**, Z! ]' ?5 Y+ ~- u
* @param args
9 Y* O( a. |' N6 ? */
`1 g# e! `/ {; k9 C( n. ~) j8 K public static void main(String[] args) {
1 w, X# Z Z* `! v( M! d7 O
i/ R {, ?3 p! H int y=(int)(10*Math.random());
' b% C0 z9 ^. V$ A* ~ System.out.println("result is "+y);. j/ m/ O1 e5 ?$ D0 w9 g
1 i u7 J5 Q- c6 h" V3 S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ {2 F6 m' |, Y# w( u
System.out.print(z+" re");
- K2 F7 ?: u; M }9 Z4 n W6 q: O7 q" g
}
0 d4 X0 G! t* c C. H6 z6 n9 @; c
% N& L3 a, y- n结果是:
4 l+ G1 r( \6 a- C4 r1 ~" s; J. Yresult is 2; ^- V& d P, Q0 _9 K# T
#
' A% S7 J2 R& o& m) E: O# An unexpected error has been detected by Java Runtime Environment:
9 Q" s* Q4 G ]+ a8 g, j# e/ _3 Y#( M# C- ^; N) ], e( F2 _
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
8 w" V" d* \3 u3 y4 {- w: E/ B#9 [/ V; x+ h+ w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( l2 t! C4 I( E+ F( j! }$ ^8 g
# Problematic frame:
2 `" h' c8 f+ }. s$ P% x# C [javaswarm.dll+0xb8305]
* [) Z! V% F- r* b1 y" T: r! \#
5 h. f F5 c1 a; b- X$ [% p# An error report file with more information is saved as hs_err_pid1064.log |