我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
* `" v" }! }7 \3 _5 I4 Y- mimport swarm.Globals;' A& L, q" v$ j4 K
, d2 S3 E7 M" ~2 Upublic class test {, x, v; n" L) x
/**5 Z/ R& R& h2 J1 r4 W
* @param args+ V( c8 d- i/ y. e2 s+ f
*/
: N3 v5 z. a" x. T public static void main(String[] args) {
# J6 _ y0 _; E1 [5 s; R & L% l, V; p( J- r$ [
int y=(int)(10*Math.random());
" v2 V* N2 N+ _8 } _ System.out.println("result is "+y); V/ m9 a3 M7 p6 M
) |6 c2 n* g5 q
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 F6 y3 l, N( V) }# R0 L System.out.print(z+" re");
3 f5 w; N0 m. @* k9 m% T. F }
% n, A7 q2 }1 q' |+ T, l0 [}
0 E3 X* o; I+ h0 o3 d! w8 \/ f9 t; s/ i; E) t2 |* k( p6 M
结果是:- T4 o6 n7 q# v0 l* z
result is 2
2 k* Y* n+ ?$ R- W: n$ a* w#
: N3 f9 G3 M( U2 A. _. e# An unexpected error has been detected by Java Runtime Environment:/ O @2 ]& g6 n; ^; q
#/ X' E9 W: ]7 W& K
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
3 s, D8 \/ C6 t( ]0 |#
) m! D {7 W3 Y5 @) H! Y8 D# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
% A$ q% e3 E* V8 U& ^# Problematic frame:1 H+ @! J. j/ z4 P2 I: R8 N
# C [javaswarm.dll+0xb8305]
# H, h) ?9 G% l# q5 b2 k#
. j; O. R ]& q3 A* n# An error report file with more information is saved as hs_err_pid1064.log |