我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 B1 j2 o% q8 L' M0 a7 Q0 Iimport swarm.Globals;' y# k* }0 _; ^, f/ v
( }+ g( ~9 W- p0 D5 ]9 b$ fpublic class test {
- r/ q, B; v& r0 p; K! B /**$ q* [0 I& s( f# d# c5 c0 z
* @param args
2 M b" j" x( U" b+ e' c) P1 V& g/ l */
, B( ] E0 e* U t! j9 G- P4 c public static void main(String[] args) {$ b/ [+ f7 d- Q9 X% H: G
( Q( x6 e P5 g int y=(int)(10*Math.random());
! f7 X9 R! R2 T System.out.println("result is "+y);
( n& \) j. w, [+ s; t7 y& i( s
# o- K- z9 U3 R5 b- d double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
" O' R( ]8 s: w x! L8 K, i System.out.print(z+" re");
/ C8 W0 [+ O7 W" d( K- Y$ S }. c0 T+ I* E/ q( g
}0 Z+ d% p& C! ~0 J
2 g: ?" I7 {6 j( X% l
结果是:
9 h) R: `7 d2 {) b3 e: Uresult is 2& p- e9 M2 q$ {$ J
#0 t8 H: r' n$ X2 A# U+ A1 g
# An unexpected error has been detected by Java Runtime Environment:
# V7 [/ H9 [! ]! u; F( _#
/ w, e6 ^: V8 }) E( D8 \0 u# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 w) s0 M6 w" q! c#
8 f: f$ \/ L5 B3 |/ V# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 A. k% c6 r0 m7 o7 u
# Problematic frame:& h' G: i( n; C& |' i
# C [javaswarm.dll+0xb8305]
5 |: t2 F' {+ ^+ r2 n#9 E- f" N1 f- i! E' n: z l- Q$ O
# An error report file with more information is saved as hs_err_pid1064.log |