我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。5 r: W/ H8 O) b7 V6 ?% e
import swarm.Globals;' p8 v# y; a$ W+ J# A' ~* L$ L# f
% f. |7 y* V/ q4 { Fpublic class test {0 t" Y3 j0 J& y) p0 |3 o* a4 O
/**
$ V, _ h% L6 R- Q * @param args; q* i% Y2 X9 x) D5 B
*/+ u9 f/ S4 Z7 t; w2 m0 E
public static void main(String[] args) {) q R3 i# g: t9 U
0 I1 L& P7 i+ L3 w' G int y=(int)(10*Math.random());
: s/ ?2 H! j4 E5 L System.out.println("result is "+y);9 K! ~: F8 J( t
* P% `0 o6 T( I% J7 f! h3 z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);' Z Y% B3 K/ u/ c. f( X
System.out.print(z+" re");
+ B( X& l; e; q% m }2 e0 C' o; _& g; n
}6 Q$ S+ ?, w- |$ h! o, k) S
7 b3 Q' i. M" J9 d& }: b1 I% s- Y, H
结果是:
) O N, J& A! N0 h' }$ Hresult is 2
w2 {8 v+ q; m0 o3 u4 t. I#0 H& l* K7 x7 B
# An unexpected error has been detected by Java Runtime Environment:: l& i1 K/ k$ |# r
#
& f( p+ }5 Z7 F9 t! n0 |# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068$ v* f- X( f6 I
#
/ X5 J3 P* a" l; K. A# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
9 L# b. w/ @% q2 c, m# Problematic frame:1 D6 J) w1 M5 p$ d; K
# C [javaswarm.dll+0xb8305]
! m" f8 G( Z1 L; \" p9 t#: g4 ?5 M5 g' b( X
# An error report file with more information is saved as hs_err_pid1064.log |