我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。! E1 d' h& F$ D
import swarm.Globals;
5 y1 a5 u7 g+ d5 y# I: f& D b3 c, G b7 z* A7 }
public class test {: w3 D& I3 z1 H
/*** J, E1 y3 }- ]( ~
* @param args
3 A4 `6 E6 M! e3 A0 y */# H# |0 {% b2 z6 H _
public static void main(String[] args) {
* r) {- i; Z; a! |1 C* a 0 M6 ~- U) y# E
int y=(int)(10*Math.random());+ i! W4 q( N0 u
System.out.println("result is "+y);3 n- r! S+ K! \# i, u
# C4 Z0 i8 I8 O- V2 {+ y# `: j- ~
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);: a4 L8 f* T6 {$ z& l0 }" v
System.out.print(z+" re");
3 z; ^. i9 c' }6 J8 G9 c }
& \4 \1 F$ y" b6 H7 e1 {& J. N}
) Y Y6 M% `) T1 x- }; I4 {5 o- i$ O) F; Y" b. h, U9 Y- u
结果是:9 Q5 {$ n/ k8 o8 j8 D0 A
result is 2, m9 L/ `/ ^# e/ S
#
9 ^) n1 K1 S7 M" X& w# An unexpected error has been detected by Java Runtime Environment:
8 @3 S" F+ s8 T7 y# }, }. v$ g#* M5 F2 P/ e! T" k$ {. C
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068 V' N; `; f/ w/ y
#/ F6 y6 J8 i* ?( \; N1 y
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" I4 t: T% T/ E) u8 @ ?, V# Problematic frame:8 x- f% S4 R7 ]. G- A% H
# C [javaswarm.dll+0xb8305]% P/ `4 M# ]( U( C
#! |0 \/ m- E. |) a! Y/ l7 H
# An error report file with more information is saved as hs_err_pid1064.log |