我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 v3 l! y! r6 c; H- U( Jimport swarm.Globals;7 |/ I2 ~& p4 }
( g& \ U) f3 f. q: Spublic class test { k8 Q3 P: I2 l7 f2 ]
/**
: {0 ^8 F& O: @4 C * @param args* b' v8 D" `7 d+ @ E' N, r
*/
& y- r% A$ G, q \ public static void main(String[] args) {
$ v) }7 @* V, t9 @* N. u g: m, Y0 E
; H% e- P- [% j7 {6 ] int y=(int)(10*Math.random());# }4 C" P3 r1 J, @) T
System.out.println("result is "+y);
* M; @9 _$ i; R- t; Y! N
9 ] a' v1 }" E q9 I+ c6 c) Z double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);) \" Y" D! J) I0 M$ h5 F7 K
System.out.print(z+" re");
, S$ P1 ~8 @- i; z3 r }% r. x; P$ l, W
}
* R6 t) L: q. m% X5 @
: H* \9 j0 @- j结果是:0 W+ T. ? ?. i4 g0 N+ O
result is 24 a4 f& B6 |. @- Q
## u1 D" {9 P, z X- H2 s
# An unexpected error has been detected by Java Runtime Environment:
# U( Q; ~# l7 p t) U0 y#9 z" \6 x- a8 t
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068& d1 N. _' C/ K6 i2 R; T
#
* Z9 N3 q$ x! y3 o1 y# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- V1 {7 L' y ?1 l! x4 l# Problematic frame:
4 b A) M8 A5 C4 t- w# C [javaswarm.dll+0xb8305]
0 Z, G7 e1 B5 |% f/ d; g6 J: N) N#( ]; H# z3 h$ _# b4 _5 S4 z" e
# An error report file with more information is saved as hs_err_pid1064.log |