我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。; n9 x5 j& F5 @, U9 U
import swarm.Globals;
# ?4 a% _+ d; g. M7 Y" a* R0 } ]( d$ b
public class test {6 V& ^& x: m8 x+ [/ I& A
/**
~0 H# C7 m- H% r * @param args8 t* u" l+ Y% Q$ M j
*/8 k/ k' p6 ]+ y! s6 I' }
public static void main(String[] args) {
/ [0 A- l" a3 `2 Q7 x 9 r6 X! z' ^1 v* c6 |) w6 w0 I
int y=(int)(10*Math.random());
$ \# d) ~. O# d' v2 v. E System.out.println("result is "+y);) C( w5 }0 a% x1 R- ?3 R# Q
9 c/ H* |- w* b0 w- Q# I% B
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
; [4 f2 a5 c0 p4 U System.out.print(z+" re");
% d# r0 U, q9 B }
* w G# p6 w! @7 c- V}2 R8 k, W8 j( v- i6 h3 D# ]5 }
# t* j- c2 Z. X- K
结果是:! X: L' C. g+ d3 c, P! a3 f
result is 2+ s @5 S8 _* u+ N- T6 v) d# S
#
0 R/ l, ^/ m1 L$ P7 x# An unexpected error has been detected by Java Runtime Environment:, q: P, {9 |2 m% X5 h7 k
#
' G$ P+ j6 a! d# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068/ b( b9 B5 _( |# M) S
#% {, D/ N# h" K' o+ D+ @
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)" X/ a1 m$ l' |+ L) v
# Problematic frame:
! J/ p2 i) Y- M# h5 ?; R+ R# C [javaswarm.dll+0xb8305]
" f4 X8 g" F* R0 u6 _. N' @#
' t1 Q9 Q- Q. H) ~# An error report file with more information is saved as hs_err_pid1064.log |