我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
4 a; l# ?+ b# `! M r3 |! zimport swarm.Globals;1 f( ^/ n& q9 u
* K( q( W3 t- G; g1 S) r9 W
public class test {% g! t) F1 S& D- J4 S8 I& R, F$ t( y
/**
! A9 Q: N7 }+ A& }, p9 g) m * @param args
9 i. Y# Z2 j' H. W */
# a; c1 m1 J& L* e! I% J. W public static void main(String[] args) {
2 \2 l- r# G, @# p6 C
. S: L/ ~. I' r) s9 }* k/ g int y=(int)(10*Math.random());: \" @0 W0 p, \2 ~4 t B' ]
System.out.println("result is "+y);1 l# A; m" q: s, e5 y
$ e2 c! |) R% a
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0); O1 G2 l8 y! ? N; [' m5 P/ F
System.out.print(z+" re");
* G0 F+ X9 D+ R8 p) ~6 T& } }
9 R0 `+ D S+ ]5 n/ N}. K# `) U1 J7 \
; S9 I& `! V+ o- O- Y& u) a. z F
结果是:/ ?* e9 r1 {: a
result is 2
$ u7 k3 v8 T) c- M#
, N" N0 U$ [. a$ X2 Y+ V# An unexpected error has been detected by Java Runtime Environment:
! a% Y1 k$ i- T) ], l' t#
0 }6 Z5 N5 N, ]5 ]$ d% `$ \# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( l# a% e7 X! M7 C* C#
$ m* i3 m- F9 ^* C5 ]% A# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& F! z) S: ], y3 K$ U
# Problematic frame:
% g2 K) E* c% `* h/ d, i# C [javaswarm.dll+0xb8305]
7 S' v6 i- u8 a9 r3 p# a#6 {+ ~0 ]- f. Y. K; B m, L/ D
# An error report file with more information is saved as hs_err_pid1064.log |