我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
2 W1 K5 V+ A' u4 j6 m, a2 O4 Wimport swarm.Globals;$ p, o: E$ V( q, p
. D8 o) c0 ^1 S9 m8 r6 [; Q6 Dpublic class test {
: X6 n6 a7 y& D$ e4 s' J# m9 ?2 ^ /**
, c: I9 h$ ?/ ]7 j8 g$ Z * @param args! i/ A; q, U( [1 r( u; S3 `4 ]- V8 x
*/
8 K' y# V$ Y! @ public static void main(String[] args) {- I! y9 t, d/ B. e* n$ n$ F! m
1 [# v5 x$ C' P% A8 e4 g0 Z int y=(int)(10*Math.random());
/ @3 ^. n5 ~9 _ System.out.println("result is "+y);
" {. O' J7 i" |8 O8 a- L- j, f- o
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);5 d) Q" a0 s+ S' B; G3 a
System.out.print(z+" re");* B3 q' \ E* l" H# d; N
}
. I6 o9 |8 B8 {5 V7 }}
4 e9 q4 r! M, f- Q" R
5 z3 q8 I& z8 z ]' h" E! ?* w结果是:" `2 W% q# B4 h$ o
result is 2
$ g+ _5 F* W3 Y' M#
3 y5 c$ X* k0 V* u# An unexpected error has been detected by Java Runtime Environment:
! C* B [! o. V0 e#
/ q2 j6 [- R( B# \* G i# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
8 H, |. c r) _( j#
( n/ {6 y( {7 r! A6 R. j8 b2 t# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
' R2 I0 `$ b/ L. d9 W8 x# Problematic frame:
8 {8 X8 w T# Q7 g0 ^. B0 W# C [javaswarm.dll+0xb8305]
! i' S4 Q% g: U% F, {, b5 h0 v! T2 _# z6 e$ u/ r1 `6 l
# An error report file with more information is saved as hs_err_pid1064.log |