我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 Q4 ]$ ]+ F- R; ?, O
import swarm.Globals;
6 G: V' Q$ a4 T# h, i) ]0 Y+ ?
5 Y" S: J) M' b: E3 _' o6 S' Upublic class test {
% z, R- e! \1 U /**
) x" F" i/ }: o. G( S' f+ ~# v * @param args% K1 J! J ] s& A# Z3 Q$ s
*/
2 b) j3 I9 s2 V: k& u& f3 I% _: t9 e public static void main(String[] args) {' B. F( O( W% {, L L3 X# Z
. Y8 x5 ~! p# ]6 X2 D
int y=(int)(10*Math.random());# J( y: q1 v4 }- E6 Y! `& }
System.out.println("result is "+y);
7 B2 c: f: ^7 s1 U7 y" q" \, {2 F4 ?# I* v9 I, U
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, a4 l7 |, F& e! s+ r' W: m
System.out.print(z+" re");
0 e' a( Q# G0 X9 g8 U- k( S6 d }" N2 O; t: n# h& u$ f" |$ c
}; a4 `7 F) M2 J% O0 p7 ~
P; v4 i% ]: e, ^$ l+ z! r! m7 C% q
结果是:* ^8 s! _& S- x6 E
result is 2- `/ q4 [; q* h" ^; i* ~: ~
#
3 ?+ g C) X4 k& | a0 f# An unexpected error has been detected by Java Runtime Environment:
" g* P4 t7 [# \; ]) B! n#3 l8 P7 N2 M, x" s: s& C/ y4 a3 v
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" T! g# u6 {% ]#, P. d+ @* P5 w& m, `' G
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
5 @. a8 d4 p3 p# Problematic frame:8 j$ q; y5 g3 [$ C; `
# C [javaswarm.dll+0xb8305]
{& j/ F9 }2 g, u! i5 S#
0 b( u/ t0 g# _2 |4 y) I# An error report file with more information is saved as hs_err_pid1064.log |