我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。8 n# D2 G! L& [# k# Z5 _* d6 j
import swarm.Globals;
6 {9 m: K1 H0 @
' `$ p* h7 R* U! tpublic class test {
2 K5 e. R! L( _5 I3 P /**
. R+ T p" F$ j. M6 { * @param args3 c, [. r/ x) E) y( b$ u
*/
6 ^2 ]& I) p2 J( X$ R/ ? public static void main(String[] args) {
" J4 M( D1 s+ x W' W, @! I : `% S) [* H: ?8 W8 H# E. p4 ^
int y=(int)(10*Math.random());* X! V7 z1 J9 o Z& J: s- N' f
System.out.println("result is "+y);
; H; _( ?) }, z" {( r# @; Z9 k- v( u- y2 X0 j+ S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ M* v/ p% @+ q$ H+ `8 K0 T c System.out.print(z+" re");
3 N6 w" K3 S: u5 T# ~* H }) \2 H0 P! P& v
}
' }. ^( ^8 K& C4 n( N5 E* w' W! {0 V1 ~! K( k2 L& E+ W) V5 C, ]! A
结果是:) [ b4 o$ C- r% z( M
result is 24 C9 p* s% f6 f/ Y1 B
# M5 O2 z) ?$ u! v3 ?& s3 i1 k
# An unexpected error has been detected by Java Runtime Environment:
/ o. I- s! z% ?3 E% y3 M E- x#
+ H! a. P1 @. r: h# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068, y" p3 ?% [$ n, l/ c% c
#8 W% L' ?. F# J9 c& t
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing). `$ x8 x/ ~, R5 [. m; w: e
# Problematic frame:2 X9 z* v' l, t Y5 p1 k8 M$ y
# C [javaswarm.dll+0xb8305]1 d6 f. C. D9 D' H0 t7 ^$ y+ \3 F
#( b* {+ ^# v8 a" R! ]2 M
# An error report file with more information is saved as hs_err_pid1064.log |