我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
) H) E1 }8 K1 ?% J, Uimport swarm.Globals;* k" u% J; n% F; _
" ~! h8 F% S. q9 ~, p
public class test {
) w; R( x+ i4 e/ @5 k /**
4 ~0 g, _4 N2 B: u * @param args
, X+ \2 n1 r4 a/ c. Z9 \7 Y! ~ */5 Q9 v9 @4 J4 c- ~# Y7 X( \) f
public static void main(String[] args) {. d, ?3 P5 @9 s, D0 k! B# e
@/ S$ D v+ u; ?
int y=(int)(10*Math.random());3 E0 O J7 { Y( H( e% {- ]% |
System.out.println("result is "+y);
; L( N4 ^: q! E# Q1 K! N' x1 k' f1 a
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 q0 Z( f8 v" @( W1 R% Q
System.out.print(z+" re");
. m2 k' `6 }* B5 U }
0 W4 F3 d$ J; V( ]6 ~8 r. b}$ Z# I _5 |8 P d
3 {- ^3 [* d) I! k6 S% ?- K结果是:
, b: L3 S* Y& l+ Uresult is 24 W3 u% v. o1 ?) a! U; ~* B) N
#
9 J& H! B b" t$ b# An unexpected error has been detected by Java Runtime Environment:) f1 T. i$ o; @& r5 @. E. B( }4 Y
#
4 s$ d1 z P/ _" a/ W+ }: J# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068' l$ h( B) G' c6 L8 E" _+ E1 j
#* J U+ |+ |/ x# L% S
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& v2 s( X# k& T' j @) M
# Problematic frame:0 y2 O1 r2 ~) A
# C [javaswarm.dll+0xb8305]: q$ A9 A- i$ w1 f6 d( y
#' A: b1 i/ |1 U' _4 M
# An error report file with more information is saved as hs_err_pid1064.log |