我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
# q" |9 h% a {' J2 yimport swarm.Globals;0 r0 n( v, ?% b% i: Z Y' W
5 C/ d" }3 n! ^+ O/ y) ppublic class test {) a: [; G& ~- O+ L! j# }
/**
4 l/ d9 @) M. O * @param args- ?- G7 a' L) @
*/
" U! T7 S% Y- Z; o; x: j8 J public static void main(String[] args) {7 ?* d- T6 u4 |- w! D6 y4 G
& j* V6 t( q" y int y=(int)(10*Math.random());
; v- A4 y% A$ ]) f3 F System.out.println("result is "+y);! K$ M1 c) w' W
* H6 z$ b# H! R e* H! I double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
* m/ f7 e3 b) [. ] System.out.print(z+" re");
3 P/ M1 ^ s: U" B% ^2 x8 y3 ^ }- Y, N# B8 N# y: R: b p6 F
}
$ w9 v( `7 v- H7 V/ f0 v6 @+ ~" {6 I. }. P' Z
结果是:
4 e4 L3 v. o2 G+ q; W1 Iresult is 2; A F0 r" ^* X( r4 b
#
* Z5 G) c, J$ O0 R* V# An unexpected error has been detected by Java Runtime Environment:
/ p( W* u4 U' N## f$ h! Y8 s7 o+ N" _% y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
# d/ ^6 v" Z- G#6 L% h" O/ ^. C7 y" i: x
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
# s" L0 }0 y: s# Problematic frame:
( m; y; J$ ~! q1 h3 h$ m! H9 P2 @9 R# C [javaswarm.dll+0xb8305]
" L$ p! }' @" K0 r# n) }: X#
0 u* ^. x+ n) Y3 `5 y# o `* [5 U# An error report file with more information is saved as hs_err_pid1064.log |