我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。& T2 L: a* [0 w) b
import swarm.Globals;
+ r* a* p9 z4 K( K9 D3 a1 W6 k0 @ z3 W1 T3 p! G5 y6 c
public class test {
6 P; y# n6 l* c* l; c. P /**
' [; C* A: J" v B+ n * @param args
' ^" {- F3 F4 z& o9 s9 p9 e6 M. m: f */& ]8 \) B: g& I) s: r
public static void main(String[] args) {6 `! p1 A2 E# C& |
) |! g8 b/ M3 Z) A- l int y=(int)(10*Math.random());1 ]* g3 p/ g6 A" ^* D: y- X) m/ R
System.out.println("result is "+y);
3 w9 `; i- ]1 U& M: L
0 L8 J, \( h5 j' H- g double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 Q0 g5 N, m6 Q. g) M/ R
System.out.print(z+" re");9 ]& I: w" r- j- S; T* |
}2 U4 t2 G( [+ f9 X& e! }
}
5 x6 D& ?0 Z4 X" x: l E; l8 Z) `" d- D0 V) d X- M+ M
结果是:+ h, ~# g; o; \3 W4 A
result is 2
! E9 [& o0 j3 i( K' D#! L& E$ L8 B5 ^+ t' U7 B4 W
# An unexpected error has been detected by Java Runtime Environment:8 u5 j5 N3 R! j+ |, L2 l7 H2 [
#
+ {2 h- U( v2 ~, A# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 B8 s, f4 J6 ]3 e
#" O- P4 x5 S6 R; q
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 F& f& ?; {+ H) ^, L& Q
# Problematic frame:
2 i. ^. v: z( B! ^$ \4 |6 D# C [javaswarm.dll+0xb8305]- ], T1 a; [3 p+ K+ N9 t
#% W; h8 \, h7 ^* H
# An error report file with more information is saved as hs_err_pid1064.log |