我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。6 s/ J1 C+ N4 U" V& ~ r6 u
import swarm.Globals;
" {2 u y* C: v% w
+ D" H) A& ?" k% B' N& w( K. Spublic class test {/ l9 |. c, o) y4 G! @
/**& p$ ^2 G) g: [0 q% p
* @param args
9 ?* C/ ]" y2 D */& S) m& _" `9 f' P: s9 M
public static void main(String[] args) {7 i, v* y# j* A( s- d
4 e0 h1 ?& \4 D" x$ R A int y=(int)(10*Math.random());
9 l, Z% {, x5 k# t0 ] System.out.println("result is "+y);1 H+ P* }) n- i: o. x: ^0 J
: ^) g+ t+ H3 T4 f double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 J: O! \# S6 T- N5 `
System.out.print(z+" re");
0 p0 {6 X& V/ ~0 l! u1 R0 U; v& _ }* {" X1 D* J) W3 }7 M7 n% Q
}
) b( }; v4 T1 j) `% R' ?- W7 ? Y: Y4 T. R4 C8 m
结果是:
' f1 W% \# L( Z" wresult is 2- h- f s: n2 T2 B2 v
## i( X9 L$ v: t% p5 c$ @# i$ |" W Z
# An unexpected error has been detected by Java Runtime Environment:; K; D- i6 \, Q0 q* b; C
#
+ {) T p* y- O& a; d8 L2 l% X+ `. ?# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* C3 `3 X2 ~; t7 i: E+ C
#
/ P0 d" T$ t: P' i$ U: P# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
( D/ C& o q+ O+ F7 V0 b# Problematic frame:+ a/ a1 s- S1 o, r
# C [javaswarm.dll+0xb8305]4 Y& Z, Y1 e5 T& v, \5 i/ X4 `
#$ O! R7 J5 [2 r. U- i) K( C
# An error report file with more information is saved as hs_err_pid1064.log |