我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。+ S- t" z1 X f4 I+ j
import swarm.Globals;. _( l8 G! j$ b2 R
1 c6 Y; q E' T! h# X
public class test {! l0 w; V$ O [; _# ]5 k
/**1 e1 b4 E9 }$ G0 C s! G3 k
* @param args F& t0 F9 _0 O. Y' e5 d
*/
8 A, A5 t8 m* v' i public static void main(String[] args) {8 j$ o9 f0 {" I9 S! D& b
/ i, H1 H+ }% Z7 D5 ^ int y=(int)(10*Math.random());
! |$ M1 y+ f0 Y1 |" P; q2 K8 U System.out.println("result is "+y);
, q. ]+ }4 Q3 T( I2 {2 r' A8 \' g7 n* V
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 F# z+ D% Y) Z' l
System.out.print(z+" re");
# P( Z$ m+ R. b }
# a( E4 d/ U* g$ T; c}
/ r7 A' M8 Z, _% P1 a; n$ d/ m! |
6 G6 v6 s0 t, U# Z& R3 d- e结果是:
% k! r' o a% v" ]result is 2
7 T. D1 i0 Z$ H3 Y/ k' ]% Y/ K#" S, @6 t3 V* b
# An unexpected error has been detected by Java Runtime Environment: t% }# O. v# U! x1 }
#
3 H) ?, Y/ f. G5 X; w# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
. H- {7 x+ M9 Y$ X4 {#
3 E" n" ^; S- |! M8 E# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 `3 x% y* a9 z0 V
# Problematic frame:
- y9 N/ ?* G$ Y7 p1 T/ S# C [javaswarm.dll+0xb8305]
" k1 Q5 P- j& q3 E$ O/ y n#& A' G7 n& Z: Y/ |1 [
# An error report file with more information is saved as hs_err_pid1064.log |