我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。: k; r- y1 T H( J
import swarm.Globals;
1 E7 h1 y% D+ B0 Y
+ ?/ n# h9 E+ Y: E+ epublic class test {
( W$ k. w* a. O /**
+ ?' v- ?; @8 ~% ^ * @param args% L+ u0 D& \; e$ N5 f
*/
$ x! d7 O( @; M3 _- f public static void main(String[] args) {
% q* G. J$ i* |7 V+ w
3 ?% o4 U7 |: L int y=(int)(10*Math.random());
+ y: K# w0 U* S# a- p4 ? System.out.println("result is "+y);
9 g [5 x2 L& K1 k C5 o7 v' A# S
' D$ ]/ q- R) D: o0 c double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);' q0 T! L! h9 V4 |* L/ g
System.out.print(z+" re");4 P: j4 \1 T0 D3 \* G
}; T' b0 g+ [+ U9 j
}
, u8 K' {+ k, F' A
) [! @+ m- C ^. S* [结果是:
8 L$ }# a5 q* v1 ?! X. [result is 2) |1 V2 i0 j% f# m' G( r
#
+ q( i n; x+ O. |- W# An unexpected error has been detected by Java Runtime Environment:
! C, H# Y- c, B' B#
0 Z8 k3 C6 ]) Y* R1 z7 G/ ?# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068' C' w# g) s: v3 r
#
* \' o2 z# R: ^$ e9 y# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
% I! T1 c b- o) v# Problematic frame:
' ?5 S5 }( `1 l5 D3 w+ N/ V# C [javaswarm.dll+0xb8305]
9 }! i: l* Y5 i8 `8 H: ~$ p! I#0 h4 [, V2 ~4 d2 S
# An error report file with more information is saved as hs_err_pid1064.log |