我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- y1 U/ B6 {5 K! simport swarm.Globals;7 u: \3 u$ K# G8 l' e+ E
2 e8 w# i; w5 B5 B0 A8 O% v5 q) t j4 epublic class test {
% |& V9 W: `- s/ B" W /**; m# \0 Z2 c( z' C7 q4 y
* @param args
6 o4 Q. I- q! t2 l6 ~ */
& T) b6 N2 i! [ f' R, D. h9 B public static void main(String[] args) {6 K7 |+ b. p. ^4 w
; |# p! A# f" `8 P* ~6 F2 f7 c f9 S int y=(int)(10*Math.random());5 T/ y" \; M- y) p- ~5 u8 r
System.out.println("result is "+y);/ s5 L( {4 ?6 S6 ^# I
# i7 v0 Y9 M. I
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
2 R; C& `) G1 ~6 w$ J System.out.print(z+" re");! E9 d7 m) V5 g: n6 m! N" W
}
P" g' A& b3 `% m}* k! E- k2 s* D
+ ?# O$ U- I# Z1 b! Y
结果是:
5 Z8 b! I8 b" p" C6 w6 `result is 20 O' N+ K; @' E" V
#
% ~1 h5 Y6 X- b v* U# An unexpected error has been detected by Java Runtime Environment:4 d+ W, U W2 \6 p
#
1 v+ Y) x P" \. d: m1 b7 C( x# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* n, I2 a! u$ }5 G) K
#- ?! N" j3 k* }/ R+ S- ?4 P
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
6 }; w7 z4 X* r: y, Z% N9 B# Problematic frame:+ N* y+ J; {0 s$ A( P# k
# C [javaswarm.dll+0xb8305]) I% w& r# d* b3 e8 @# ?
#
3 [ H, N, g9 A% B# u2 i- [# An error report file with more information is saved as hs_err_pid1064.log |