我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。+ X4 j: I K# l [4 ^: \6 W+ K
import swarm.Globals;
0 |) T7 q$ M9 P# r
D7 X1 S2 y+ x) a4 z5 }4 v4 Upublic class test {0 O( o1 V8 J3 u- u8 e, i2 l
/**
- E5 l( J- {$ D, g; @6 `" ~7 T * @param args2 |4 c/ f. o0 \6 ]
*/
! k, m& ~9 Z: g; O public static void main(String[] args) {
7 P/ m0 v. M" R( Q) R4 G 2 ]$ r0 q& `6 W3 k: W. P
int y=(int)(10*Math.random());
& q/ D/ T: F+ I) O0 a$ E+ P" P* v4 X System.out.println("result is "+y);
- I! J$ w+ b2 T$ m/ k& e/ G8 B/ v' h! c, B' V& G
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
% I+ V1 W# }& h. { System.out.print(z+" re");5 \) B4 e8 q3 P# m
}6 d: U# E" D0 E+ V: U8 ~6 e
}$ F O" [, ~5 R2 g
: s+ Q- p0 m1 w* N. L
结果是:
& P* H4 ~* N7 U* ^7 y: Iresult is 22 a! J5 l3 t8 P7 P, Y9 V: {
#
+ @4 O0 D4 l' N4 ]; |# An unexpected error has been detected by Java Runtime Environment:
/ E N' h$ y, L0 {& d#6 f0 o& O8 i$ H- ~' e, n' P
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! p7 h6 h3 J( x; |5 q( g$ N
#2 ~) J3 h, d6 a& R* D
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)" _/ B5 Z# S* Z5 i
# Problematic frame:
% u% ], i8 z1 M# C [javaswarm.dll+0xb8305]+ L) c3 Q* f* u4 T0 `
#
' u! N. v4 w7 _! |: K; z) t, ^# An error report file with more information is saved as hs_err_pid1064.log |