我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。0 M6 t' [' h* }, ^" Z7 n. i
import swarm.Globals;, e4 I5 T) H2 J( a/ Z, _
( H7 W+ ^. B% Epublic class test {& z6 R; L( K/ I2 W; ?- y7 A
/**
4 U5 j) N: }' r L2 ?, h6 q* _ i * @param args
/ U" @. Z0 ^2 Q& g7 l */
/ `! l6 u/ n( @% g public static void main(String[] args) {
~1 }0 o7 [4 D) J$ C7 c( G; [ 0 t$ m" p- B0 F7 ^
int y=(int)(10*Math.random());2 b" a, Q# `* r0 s6 U" v; J' A
System.out.println("result is "+y);* z. S0 b5 V& @" j2 d
! N! ?- Z' ^: T- b+ e+ W
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
! p; O) U1 U( p8 K, C% p7 p System.out.print(z+" re");! l$ I0 J1 |( @ T: W P9 F, Z
}+ C# r# p" l2 ]/ s: l
}
; ^% V, o D4 P7 U) r$ p; s+ N; ]' `9 [" `8 s
结果是:& j: _3 q$ q D! M* J" g9 {. m' R) w
result is 2
2 e( [ L6 l) {- f# i) k- D& J! G: u. u
# An unexpected error has been detected by Java Runtime Environment:
2 x0 a& O6 M, Q3 d## B' n) h# y, W% O& T% J2 i6 h, X
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: A& i3 R% g+ w1 R4 V#( x' w6 o) K7 V# B! o* |/ g# s
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)1 A9 A1 f7 p6 r- i8 \
# Problematic frame:3 e G# P. R5 L7 }. N
# C [javaswarm.dll+0xb8305]
9 H5 k7 X2 R2 Y* x* ]#, c# W+ s2 g, W$ H9 R$ u) w
# An error report file with more information is saved as hs_err_pid1064.log |