我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 G1 d7 o7 ?' y( w. o% N& w
import swarm.Globals;
3 i3 ^) k* l, [" A
" Q) N) z' L$ r( N# Bpublic class test {
# j4 {( C/ ^' n& _. h /**" b$ ~; F8 ~' ^* e+ }# p0 G
* @param args3 |3 t* V% Y8 d. j
*/0 h5 k6 D$ R( {! B2 X
public static void main(String[] args) {1 t) o9 H# h+ Y. M, }
; f. g+ g! S" H
int y=(int)(10*Math.random());, G5 i4 ]; c, b) r: g, J' u
System.out.println("result is "+y);
" ]7 M2 }8 Y6 Y2 g/ \+ k: B& ~
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
* [! a- ^8 u( @- |2 } System.out.print(z+" re");& O8 B$ e" H2 L; o1 _% S3 E) c
}% w/ p' m- G/ |; Y0 H1 T! N
} o$ v' ?; N2 z- a) |' {& _+ F
4 q" }& t& t6 E6 o9 n
结果是:# o; k3 h; N$ B! p
result is 2
1 V+ U A4 `+ z: B# k#
4 V8 k8 T7 d: }1 d* }( V# An unexpected error has been detected by Java Runtime Environment:: y9 B3 j% @ V* P; w
#: X/ @2 d, \' Z9 W0 m
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
) K3 S: m M! [2 z1 U0 O#: X6 V% H: ^0 w; l6 G' ?
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
8 A% r+ Y+ [. B6 n6 |$ k# Problematic frame:
0 S3 d6 X) D8 i) s# C [javaswarm.dll+0xb8305]
$ m( j; j; m+ n" ?! Y0 V#& r* |6 g# |$ ^ O0 u3 I5 ^3 S9 Z
# An error report file with more information is saved as hs_err_pid1064.log |