我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
0 u0 ~4 }# j C& [3 @; W, Cimport swarm.Globals;
# X/ E3 `1 t0 r( p: `) r* g7 m
4 g7 h* q1 D7 C1 z" Upublic class test {7 A7 k: }. W; g7 p9 K
/**5 R- u- ^: H1 A+ \# |' C
* @param args; y" z+ O; f$ k/ V6 f5 o" q
*/
" U1 [. E3 h0 i public static void main(String[] args) {
( F6 F U5 M$ p* p9 i ' A) S* f1 c; N* z+ [0 l3 I
int y=(int)(10*Math.random());1 O. n, F" a- s6 a
System.out.println("result is "+y);
- M& h. [) M8 M3 ~' _) h
* _* u# @( P! s" W) Y/ n double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 ]! x' U* H% C
System.out.print(z+" re");6 r& p6 a9 c- Q' @
}2 W: T3 K- W3 p! C5 y; [
}
( |) w( M P3 b5 a) I% r+ c7 F: g" T3 s# l& m2 j
结果是:4 b/ z6 _. d, A$ P
result is 2
" R6 Y9 v: L. h#+ j7 h& _& J8 t. b
# An unexpected error has been detected by Java Runtime Environment:$ F: J# T5 b( `8 s# K# `/ }
#$ n; |6 N2 U6 K& m6 s0 f
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
t6 i4 h' b @ ]& ^6 T; N#7 _+ ?' c$ f9 P7 @# e8 @- w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing): ]3 g. X$ X" B4 ], j5 _3 p
# Problematic frame:
2 o! g' {1 B. l# C [javaswarm.dll+0xb8305]
- C2 i9 R+ y5 z& |$ z8 x#" {% k7 u- ]0 \! ]
# An error report file with more information is saved as hs_err_pid1064.log |