我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: X" l2 }8 m% G6 J3 simport swarm.Globals;6 t, L* e$ ?/ X" T5 I) K
+ ^7 i E0 E: epublic class test {
! U! t# L: p X& `( z$ d /**
6 V* c0 ~. m. ` * @param args
2 ^' q) y! v) ? */
) C* z; A8 x+ L0 Y public static void main(String[] args) {2 w# C$ P. O+ l0 S: v' b4 q
- I5 j/ c/ E' } A5 b! b0 u
int y=(int)(10*Math.random());
, {1 x$ {8 @, [- z, W System.out.println("result is "+y);: P0 ]) p8 f& g' ?( D9 o( _1 p
) R# w4 q6 P: f double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);! }" u. O" H: L! A: A
System.out.print(z+" re");
* r, r' p$ A: T* R, G }
; s7 E( \" i& w}. t' R" m1 U" m0 Q! ?, A
& W$ Q9 X3 g* o0 u+ F; Y
结果是:
; b& C& z4 g5 h" O Fresult is 2
! C( Z$ z! ^2 |8 W- ~! b, c9 _#
' {! k5 M/ I, U: `! p7 g# An unexpected error has been detected by Java Runtime Environment:1 [, n7 Z2 A+ [$ s J+ x
#9 g8 R( f& a; e& O, j
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
! P2 b( U# b0 c#
% d* @2 v2 ?7 N& f) X5 {2 y# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ H: f0 u2 @, l4 O- E5 _
# Problematic frame:
2 b; T8 N% ~* Z+ ?8 q# C [javaswarm.dll+0xb8305]9 ~) G+ p7 o0 G V+ h! ?
#
# T$ G2 v) \% O/ F# An error report file with more information is saved as hs_err_pid1064.log |