我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。* W( y1 G5 C! e6 E
import swarm.Globals;* v% h6 v3 S2 x# \
& Q' f, r |' D5 |/ r6 h# qpublic class test {
0 _2 \0 f) l" `* _5 p /**
3 i0 ~2 \( T* }; g: T * @param args8 w* @) Z% J) ~5 r
*/4 M; v; m$ Y; A; b/ S' s
public static void main(String[] args) {
& ~( E' @4 W5 o3 K# P0 Q. [* y 2 B# z! G, e; ~
int y=(int)(10*Math.random());+ d* f, j9 t0 J- v3 P$ b6 _' B7 h
System.out.println("result is "+y);3 J: }) H0 [' Q; Q7 C X
% A- B0 x9 Z' T) O0 s0 V- @+ q double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);* i2 n6 c1 U9 d2 m( c9 d, j' I+ O' R
System.out.print(z+" re");
. U8 I, {3 l# ~6 [% @) J2 c }% m7 H( I$ b* s' D+ {
}
1 w% U/ Y2 `' n. @5 |6 N! t; _& ^, G$ p$ E8 }+ B' D0 b q
结果是:
' a5 p$ c W+ f' `" n3 Y' d0 Aresult is 2
% Q6 x/ l( _1 H8 q#
% h1 w8 ?7 X& P# An unexpected error has been detected by Java Runtime Environment:
: \+ l8 K0 }8 P% R#$ d# |0 y @% [7 f' _: W4 J( x$ R
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
1 _2 N! A, z5 P' F$ _1 G#. P7 ~5 T( @5 D
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ t: H: ^, N# P) @
# Problematic frame:9 F7 D& N" M/ c3 N( N
# C [javaswarm.dll+0xb8305]5 Y0 v. q, v2 t \
#
4 R2 [6 A0 d% @2 W* \$ D- t2 D# An error report file with more information is saved as hs_err_pid1064.log |