我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
, }2 \- {& a+ e* C$ Himport swarm.Globals;' s* D; p0 F* i& `& L @2 y
. C. H _. D8 L0 `' U- W
public class test {
: N+ ~# {% o# } /**
0 C- W6 H6 S5 k7 _) s7 M2 Q * @param args
; \- \: d' \( {! B2 C" e( Z */
& f S' e h) Z" w: L% u7 Q( j public static void main(String[] args) {
' l, N; E: K& k+ A+ P G
D: K; x) b; ^ int y=(int)(10*Math.random());
8 h3 w* O' V+ T0 t. m System.out.println("result is "+y);# B0 c( o$ I# `$ f2 n
& x% D( w' B1 k3 a/ S2 m/ J
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 I9 M; C! J3 |% e5 f System.out.print(z+" re");7 K6 h3 O4 ^) o. L1 a
}
. ?! Y" x" f+ Z K3 y. |) A}* y. |* J6 u0 a7 ~" o) L3 D
: K5 `$ W/ E' O4 `/ T7 l: |. o$ m结果是:
5 O2 |' n" i* x5 V q, }result is 22 \9 }& k+ g4 [
#
$ N1 t4 c, P- {6 F1 E. Z$ ~# An unexpected error has been detected by Java Runtime Environment:( O e4 U3 w) F+ u
#/ d1 M) J. j, |1 d0 U: a5 ?
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068' S6 U# y% z7 a, D0 q, {
#
* s. R% Y8 M# b6 v1 v0 P# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ k: q, \3 ~6 p9 w" v+ `$ P' Y3 M
# Problematic frame:
) I9 Q K- Y! {8 K Q# C [javaswarm.dll+0xb8305]; b% N4 N, E1 M+ R. ?8 U# A
#5 C) p: V5 e! r" }- S o
# An error report file with more information is saved as hs_err_pid1064.log |