我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
; w* N/ {( s- wimport swarm.Globals;
: j7 A) _" c! v% r$ g+ J( v+ s7 X
" ^. f! x/ \- U6 d# U) Lpublic class test {5 m9 ?& T0 T# I B" w0 S, o
/**
; @ |, A5 | }1 d- w* U" q/ M% y * @param args3 A3 |: f5 q: [
*/* [6 D, u4 m1 X2 _* a- i
public static void main(String[] args) {2 T4 r! k6 M/ P6 G* m
6 d/ U+ Y1 z# Y6 d. l y7 ?
int y=(int)(10*Math.random());8 E+ W. W4 r7 L0 D( X
System.out.println("result is "+y);3 A$ Y$ ?9 G' ]* \! e
4 B; ?( x" @8 n0 }6 I+ l$ I# b
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
- S& F# J. M& D# @. W5 n System.out.print(z+" re");
5 d6 |! V/ {; m9 f" |2 R3 H }% l% y x; T) L$ d
}
( i/ S5 \; f# z7 e3 ?5 {; ]1 j- [! v4 K, \( Y7 x# ]* W6 ]# _) S
结果是:2 K" `6 E1 G2 ]
result is 2
0 ~: v- j/ o0 c9 R2 V0 f#! R+ ^$ P7 B% n; C% ]: X
# An unexpected error has been detected by Java Runtime Environment:8 Z6 {; A6 y( d5 O4 Z
#3 r, M# T: |: R, L( ^ h$ _. E# o
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10686 r3 H7 R3 c0 P: G. j
#
7 \+ }2 y P; Z s' z0 h3 v# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)) s y+ O6 k" `) a7 @5 j
# Problematic frame:& i) Y9 u( D% |# I1 }6 X* b
# C [javaswarm.dll+0xb8305]$ C C$ d$ j0 Q, _+ L6 b
#! i3 ?9 S! X1 J) |6 h
# An error report file with more information is saved as hs_err_pid1064.log |