我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。& M8 k1 ^1 K5 e! S. Z/ a, S8 z2 r! H
import swarm.Globals;
q' f+ p9 K9 l( {0 F# H D! V$ ]% X+ |& k* }( E
public class test {
9 z1 W7 x! c& d' y+ Z: F /**
" S7 U4 K- y7 o$ u" _3 ]# |2 ~! Y * @param args0 J- ?8 S# o1 e0 @7 Z
*/% V' }1 H C- Z% h0 m3 B0 U
public static void main(String[] args) {
/ m; j* n4 n% R, M O9 w2 n+ j( y
1 {( T/ L! t2 _5 R" { int y=(int)(10*Math.random());7 M& A/ e' r% w9 @) {$ w
System.out.println("result is "+y);
0 d: e/ Z7 Q m% J! \2 |
7 ]+ b2 e0 D! y8 n9 T double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);6 c N4 Z% a+ T9 A( g7 `
System.out.print(z+" re");5 p& G( }& N7 n# p1 _" w
}$ E( Q: b6 [2 Z0 Q) ^6 i" }3 B3 v
}7 y1 W% x/ a+ R ]4 X5 ~2 z
6 a$ U5 g5 d. {5 n% s; f; R结果是:) u7 n4 X* W* I B# [* |
result is 2
$ ] P9 I& l1 [5 d2 e; g/ i/ w#
* s- K8 F% v/ _# An unexpected error has been detected by Java Runtime Environment:3 F3 l* o! J1 A2 e
#
, P1 [/ R- Z1 @2 I$ ?1 |( E) u# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068% q& [1 R- @9 ?5 y
#8 U- W3 o0 W; E5 {* G0 Z) v
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)- T3 q. i( m1 Q" c
# Problematic frame:
2 ^; R0 ^5 k. r- T+ Q# C [javaswarm.dll+0xb8305]! r$ r# ^- i3 \2 n
#! D9 @, U. ]/ H# ]
# An error report file with more information is saved as hs_err_pid1064.log |