我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。% M& i' `- e$ `, ?
import swarm.Globals;
+ d9 Z; Y* k6 y/ g) D9 z" `1 j: A- n9 D) }1 H# w
public class test {7 J! ]5 a: i3 D/ ?) R
/**2 z0 E3 T: T5 o0 T4 I
* @param args
2 I V6 g4 C# U */, b% I' s _7 k' N( q
public static void main(String[] args) {+ @- _6 R7 S4 s, A" d
9 `5 l4 e+ p8 N1 M
int y=(int)(10*Math.random());% T0 V) M8 [7 Z; v: D& F/ Z
System.out.println("result is "+y);8 k d M/ O/ ]% g' C
3 F) Q' X$ `/ E, ]
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
; o I0 r9 `( Y$ x9 U3 c( i( C System.out.print(z+" re");
0 g7 L! [5 Q1 { }8 w4 O7 x- s3 P3 y
}
1 V' t# o% I7 P4 t+ h& n
- f- f; Q ~+ m$ w+ v结果是:! y1 M7 e B( j" Y9 [
result is 2
1 B$ b2 n S3 `1 X#
6 L" k$ H9 y9 U- K% \* Q: k. a# An unexpected error has been detected by Java Runtime Environment:. P6 ^; f1 Y; p# }! R
#
) D+ q2 g3 N( `9 D! @% }3 Z# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
4 S* L0 R' j+ _8 Q+ c) ~#
+ E2 q6 A; V6 ~) t8 o7 M# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)0 s" m8 ~" t6 S. E8 P$ ~( z
# Problematic frame:- e" {& E1 \( D5 C' Y
# C [javaswarm.dll+0xb8305]/ E! Z: g0 q- W$ k
#$ [* b+ H% U5 C* l; M
# An error report file with more information is saved as hs_err_pid1064.log |