我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
' \! W0 A( f( b( _import swarm.Globals;
3 O2 F3 x, w4 ?6 U' G! F
3 Q" B! P* o/ I( ^public class test {0 _ J* m/ w4 T& [& B1 T1 w* s# k/ B h
/**
+ J$ s! H8 s+ R$ i% F, P" ? * @param args
: Q& I, F8 D+ H: [% n+ Y( ? */
/ B& K$ f" L. l3 a public static void main(String[] args) {
" n0 |( B9 H! g : v0 k$ a* [8 T* v6 R
int y=(int)(10*Math.random());
+ P; G8 m; `3 {* m System.out.println("result is "+y);6 a5 D/ p8 K' T- B
% {: _8 y: l# t
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);2 C3 h6 [) i7 c' v
System.out.print(z+" re");( i- d; L5 g6 W. n5 `$ ^/ `
}
$ ?" P2 m. n' ^( Z}
" [ ]0 e+ } V) T/ ]2 U% N* f
! [+ T9 O2 q0 e5 e' ]# w8 k2 c结果是:' ~6 r/ N& \ K6 f/ {# ~
result is 2
* h3 W I- B+ f- d#
; G T& @* E. \2 f# An unexpected error has been detected by Java Runtime Environment:
/ I _3 a+ d+ }#. n% @# m1 X% w6 a5 D& l
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10682 }1 [1 E* o) q1 [
#
{3 X, d/ [9 }7 `# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 s; Y: \% f/ [9 F ^2 z: P: ?
# Problematic frame:
) s- Z* k- b4 g2 ]9 E* J7 E# C [javaswarm.dll+0xb8305]* O8 L- u% |1 c1 U. ]
#. I+ K( o! G" V) w
# An error report file with more information is saved as hs_err_pid1064.log |