我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: K* h( h( p. X# H8 eimport swarm.Globals;1 v- g7 w4 c. A2 m
# Z- b. C' a. s9 X1 x8 l: c; spublic class test {
" C! t: H- [% a /**# {+ b$ M. g+ X! A5 n; X1 x
* @param args( d/ `7 P4 M; Y0 a4 Y
*/
: ]1 S, M; m; M& @ public static void main(String[] args) {4 ?& @: _ n: M
6 E, E$ s# Q. B6 a1 _6 ~2 f+ N int y=(int)(10*Math.random());
' g7 X# l# B. w/ [7 u System.out.println("result is "+y);4 s: ^, _$ p% f% J
2 J& S( N1 o3 z9 F double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
* g' D7 j$ u. X$ ~ System.out.print(z+" re");
! l- C f) p! \6 i }+ i8 P! x# k8 y" P6 T
}6 f L" p U! Z: p$ t
$ }; X4 g } R. w+ R9 z9 d- d9 h
结果是:1 ^7 u. Q+ ]. d# G* ?+ ^5 s
result is 25 z1 e9 J* F$ n# b& h' V# d
#
7 k! p2 S9 }# w+ I5 C2 p5 I3 G# An unexpected error has been detected by Java Runtime Environment:; G1 ^8 J' K# z
#
* O9 O% m. _$ n% B$ `3 Z# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068; W; S$ @! w: y3 v$ F
#& }8 ?$ h: {! s8 c n( m" P
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ z4 K. p0 S/ ]+ ? |* {# Problematic frame:
! [# Y" y. G/ p9 V# C [javaswarm.dll+0xb8305]
* F* ^3 I% u8 _3 ]; h/ }#$ D+ S/ J- s! z( p8 r' ?' V- n& ^( x
# An error report file with more information is saved as hs_err_pid1064.log |