我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。: h4 c. l' [; V2 ^* G4 M6 f
import swarm.Globals;: Y) ?8 |9 V0 {5 N* F) v5 W
" X" D6 j" x; Z6 g* ?5 ?. `8 {public class test {
' R, y5 F3 _) N) s /**
6 V3 y% L$ }% L X( B * @param args$ t$ k/ g# H* W2 ]5 p( q
*// c' T c; o! {. X- q+ E! B
public static void main(String[] args) {; j' ?9 E& T+ E+ z
* [* Z) p" g1 J3 Q! k/ ~* g int y=(int)(10*Math.random());+ G3 Q' t; E, R# r/ `. h: B6 E
System.out.println("result is "+y);4 ^2 u+ Z5 L& X: n9 }
7 \, f+ X* a( _" E! G5 y
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 k* b) a! z) N& G' l System.out.print(z+" re");) [. x5 ^- N5 H9 u
}
A- S9 S: ~' ~! r7 p0 ?" D}
+ m+ D! ?# U: t- Q2 G& z! q |/ V; x. {1 t* }. }7 X. Y
结果是:' [# E$ m9 I) f# }9 z5 f8 p' ?
result is 2
; e- h- m6 V4 @; g6 |#$ Y' B! @. w+ P O* k8 a, s$ i& u
# An unexpected error has been detected by Java Runtime Environment:
, p4 }7 Z( \3 |! s5 }9 w4 n#/ A( H9 ]# Z5 |
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068% r1 u0 {8 Y; F) |. G* v
#- M+ E: o0 W& _* J5 L: K
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)9 \' B. g( s ]
# Problematic frame:/ [% `$ q+ ]9 Y" a) l* _
# C [javaswarm.dll+0xb8305]
- _: ^ [9 ]# K: g6 T" A- V#2 d5 \+ V* H( N0 @ v* F' T
# An error report file with more information is saved as hs_err_pid1064.log |