我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
* e- k/ r% D" k5 P# Wimport swarm.Globals;6 p, X- v3 [4 a' w$ X0 W
5 V( k m* Y5 G; v1 Mpublic class test {/ L, f5 H% t; K% k9 O
/**5 }* s+ B5 Q+ G/ |
* @param args
, M8 d. P7 E5 k4 ~4 f% \ */# @: r# Q3 s$ N
public static void main(String[] args) {
0 a4 f/ {' ]. w# i 0 R# }2 T8 C6 c7 O, a. t
int y=(int)(10*Math.random());
3 U `- L- R- X$ {0 Q' k5 }9 l System.out.println("result is "+y);
2 a) u$ f0 x8 W5 h. h. O- y( Z! p) t/ E$ |* }$ m7 x/ Z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 c) w% {8 C) f/ x$ I* v+ a8 I& Y) b5 c System.out.print(z+" re");
8 Z, n; w7 I. j& K- A; D! K; D }
' S3 M+ N% v. x' Q4 c}
2 c- U* ?- [/ ?! f% a6 K
0 l. d5 n T) q/ ~+ ?结果是:
8 F* u4 c0 o X' s/ C1 A9 M4 }result is 20 G6 n6 P; `& G5 v V) R
#5 v: J; b9 ~9 B% f. Z, D' T9 ]
# An unexpected error has been detected by Java Runtime Environment:* e/ O* R$ \0 T; N3 m4 D
#; R& l3 A8 k' h# f3 s
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: ?% F! w- l; V5 K/ s#& q! d/ ^ ~9 Y) g; N
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
3 }0 w: Y- F+ f. p# m# Problematic frame:
u% d" _5 d4 q- F n, f7 @0 |# C [javaswarm.dll+0xb8305]
+ p! [. Y0 y7 ]( I" r7 t$ I#
( n T9 S0 n/ Z X* z# An error report file with more information is saved as hs_err_pid1064.log |