我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
5 @, [4 b h# b* himport swarm.Globals;
% x% c$ q# @! G
9 x$ w3 M) S; \/ r }6 s: n) bpublic class test {
' E6 o3 c' L- x/ p# `/ d2 | /**
2 [/ i. j/ y* x' T. ] * @param args2 r; e, K- Q: G, d4 g
*/" q3 O# R8 G. z9 @6 w2 y8 B
public static void main(String[] args) {
, q/ S: P/ O, ^3 I, T , c* o1 q* t" i
int y=(int)(10*Math.random());
7 K9 m$ \- c! \$ t7 g System.out.println("result is "+y);% ~* N9 G/ N: @. V, P
; R: w: j4 M+ @( i) b# ^) ` double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 P. K% p6 q6 \% o# z1 R9 J
System.out.print(z+" re");
9 @6 k1 x- O$ q7 f6 q9 e" u& L }+ o. K( B: q% ?& A1 u6 W1 t
}
+ n( t$ k' f& K6 l0 d8 ?
4 X) i9 L5 y4 p0 g结果是:0 c. Q( ]/ _% R/ h
result is 27 K% \7 U S) G" o
#( d4 G, k ]9 T% P2 k( I, C4 {4 }4 [4 m$ s
# An unexpected error has been detected by Java Runtime Environment:& L6 s) Z r4 R
#) f0 M2 q8 w8 ^: ?5 H$ R: n
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068. O0 E' ]2 G5 y$ f
#
. m% F" X D3 A# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)) C9 b. A. o9 O6 S" e; ~1 ?% D
# Problematic frame:
. s0 N; L) c1 A4 V1 b# C [javaswarm.dll+0xb8305]8 ~8 D+ w$ A( U8 @7 T: V
#1 r* N, p: R* }9 {, G6 y# _ y
# An error report file with more information is saved as hs_err_pid1064.log |