我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
) s+ G5 l" \# G* E, S" Timport swarm.Globals;% K( ?6 z9 N# E: j$ K- W. W# U
5 \ c% @6 _5 c& x
public class test {
( w. O/ A7 w/ ~/ `& @4 e /**% D' ]' Q1 |# h
* @param args
& r1 f! }1 I( l4 n: l2 L */1 e$ v# u* s$ t0 C7 q4 @
public static void main(String[] args) {
$ F8 |/ C) c1 U' X1 } 8 u0 e, m: g/ K
int y=(int)(10*Math.random());
2 P \$ S3 X# \0 g* x, g3 s5 F System.out.println("result is "+y);
5 |' I- Q. C2 o' W- ~* u n1 y. d H0 L/ b' b
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);2 |5 a: E6 V. u
System.out.print(z+" re");
' U" G" w; o' E4 K" B: a8 S, I } J+ ?$ ]7 E9 l
}
0 u, X+ ?+ ^& J7 O1 q+ F1 ]
) |+ q3 |0 Q4 F- q( C结果是:
& W9 r# _1 Q: \! r. z2 a ~% sresult is 2. A0 {% {2 D7 F+ I0 o7 Z
#
$ s. s O! L3 O- w# An unexpected error has been detected by Java Runtime Environment:
% F" \( k8 l& k% W#- c% ~) g; A+ D4 y# q7 W7 E
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
5 `' M& g; r6 Z#
1 i' c4 c8 v5 L; P# E. ?2 p0 s# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)' i. B# B% T' j( r' s1 e
# Problematic frame:
9 O& F2 F0 V$ ?# K1 a$ U; l( ?3 _# C [javaswarm.dll+0xb8305]! W$ V/ k. i( V: J! x, B$ E
#- @, u2 T& F! x9 K
# An error report file with more information is saved as hs_err_pid1064.log |