我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。# I8 Q' ]4 K7 b. A4 F& H
import swarm.Globals;, |$ V, o+ P+ K2 M; Q2 x
( S+ K; w& o0 B; a( u
public class test {
: w: e+ [! w( E$ |3 s: `4 W /**8 T2 P! E, B4 {
* @param args
; w8 v8 {( ^( }! D7 W' P" W */- ]2 e- ^+ [9 k& J$ R* T
public static void main(String[] args) {
; d9 f) Q4 ^1 S: a4 Q . [( C% w% |$ w( ~3 L7 X+ m# W
int y=(int)(10*Math.random());6 Z; G. m* E% L# J% }/ D# l
System.out.println("result is "+y);
& l' H7 F' x, U1 m1 n7 `7 H
/ j1 P' v" C2 v, Z3 @0 M0 H4 V6 V double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
2 R. w: l9 j! b* C System.out.print(z+" re");8 K5 S+ U6 M' w" I& ?4 r9 F
}% r- \5 k3 f9 P* F
} P/ H2 z2 F6 ^3 b2 K& S# A
7 N+ k6 U# [, r9 M7 t' v- E结果是:0 s* K- [* R; x; d$ d3 _
result is 2# k5 R. v! i4 d7 w H3 g
#( x2 X% K3 y9 n, n: L! L1 `
# An unexpected error has been detected by Java Runtime Environment:. k; ^0 l1 T5 Q& F& l) a& t1 `7 r
#4 D2 M% e7 y( K$ m: d, Z, C2 U3 P
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( V0 l5 m7 e0 Z+ K#
/ Q% K. r$ o8 I) S2 t. B8 o9 V# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( S. H! T3 q2 |9 ]5 N4 _$ o/ p3 l0 N
# Problematic frame:
0 l0 c# V: T9 C; e/ d# C [javaswarm.dll+0xb8305]! \1 Q a+ y. I4 j' x; e
## ~" E. y' k/ f) b) ]6 A. c% Q
# An error report file with more information is saved as hs_err_pid1064.log |