我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 Q# I4 U0 r* c
import swarm.Globals;
$ E7 [# t$ X2 I' P
$ d1 p1 R+ q% X+ \# [5 Ipublic class test {, ?, e4 I! w0 {* }: `- |- u
/**: M/ u( ?( ]$ }- u4 x7 Q. A! |
* @param args
H( {( V S/ h( l/ L/ Q# j0 o */
9 F# a# K# @: I+ }6 a5 L" B% y public static void main(String[] args) {
( H# E) b1 [2 K P' @+ T) p7 b
+ E. l" e D, I* _& }% B' x int y=(int)(10*Math.random());
9 q# n6 i5 b3 l V System.out.println("result is "+y);) |# g- p: Q0 y. r( h. J1 r) G5 t& f
F+ x% S# ]) h* d8 @( q
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ B( }7 p4 D8 V2 X4 K. P2 |( B V
System.out.print(z+" re");* A2 ^$ a, h4 t* W. T* e% B. D
}6 D! y* M3 [* z8 ?7 q8 S9 w
}4 s' \0 T! ]4 d3 k0 M- ~$ B
; y6 \4 G) D! x# x9 a结果是:% t3 m( q' P v
result is 2
, B ~; d8 i% Q) G#
' J: L6 y6 r7 V$ w2 B3 p6 a1 v2 S# An unexpected error has been detected by Java Runtime Environment:- e* F, {8 u+ q) U
#2 M, u/ C2 g6 C; H" ]8 C+ ^
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
+ V. j) H" W" }, Y$ o3 O- c: a#
" h4 ~+ A9 s. S0 B8 r( H& o& W# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& `! J+ v/ d5 z) w0 Z( {% x
# Problematic frame: s3 s' X+ l' u7 h1 J5 @. W
# C [javaswarm.dll+0xb8305]" f; C8 R8 d& ]+ ]) s+ G
#, _( F: z/ ^ Q; {% Y
# An error report file with more information is saved as hs_err_pid1064.log |