我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: U: }! {) i( w. t( Zimport swarm.Globals;& W6 y( T" Y& N6 h0 b8 C1 a0 d
+ T/ h/ E5 F/ x. y" ^
public class test {2 i, V- z1 l2 v0 _
/**, }1 s" k) _% j3 }- K
* @param args
! A+ m5 w m+ t: e0 X2 \ O */
# T3 _! G( V9 I* M0 W [8 { public static void main(String[] args) {
/ ~+ l( x4 d. E9 n @
: T( o' U+ V5 C int y=(int)(10*Math.random());
# I0 g2 P" H# J+ I* @9 A' I! L% z0 w System.out.println("result is "+y);0 ], `; w6 S Z/ F( D) v
, J/ z/ l4 j* ?7 L* u/ M double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 L' Q% ^& A8 b8 C
System.out.print(z+" re");6 K+ M* k% u/ K! W% ^) x( n# W
}
; g: k# y+ c& R# e$ Y}, L* J( K' X8 B4 B# a4 e$ i( f
2 ? {" O; p& B$ t g0 `5 I( O- D结果是:
6 y, j! c0 q% ]- s ]result is 2
0 M9 w) }" q; M. B9 ^& P. G#( \/ g; \' z( l* j; e P9 T/ Q) P7 P
# An unexpected error has been detected by Java Runtime Environment:
2 v" c* ~5 ?& H#* E) l, g2 V0 _+ u1 ]& D
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
' Y# s" n0 S4 j# T. d2 r; i#
: w2 T3 s% \: Z) ^# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
, Q9 S, x5 y4 X; {4 I9 M7 K# Problematic frame:5 ~2 h* y$ w) x: J- |3 x5 j4 ?
# C [javaswarm.dll+0xb8305]
, R9 j, e7 _" R5 c) O+ B$ r% P#
4 v! z4 p( P0 d1 z6 G- W# An error report file with more information is saved as hs_err_pid1064.log |