我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。. ]5 _) m) e% h5 p
import swarm.Globals;
) E, `2 r6 F: x9 {6 {) X8 R' p0 O/ [0 m0 q6 a2 u0 G3 U
public class test {
: l' _1 x9 I2 m6 l, L /**
7 j9 [0 Y+ M4 H2 E, j. ]9 h U * @param args& U1 n2 N" I9 U g
*/( }6 d! s4 s* g9 N' S
public static void main(String[] args) {6 M* S- D+ E6 _5 b1 D. Z
& G3 p; Y* d% @0 X5 A5 b8 {
int y=(int)(10*Math.random());4 M+ t4 _* f+ }. j5 \6 I
System.out.println("result is "+y);
9 M1 ^% I" M# q4 g X
: c. Q5 }. M1 o0 l, p% p. \ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
" L5 }0 M; m0 b1 }, P System.out.print(z+" re");3 F0 m! I) e5 s' Q8 K
}
3 ?6 H5 T3 _# k' \/ u! t7 e( W% [}
1 `# f. E3 D+ H& X1 v% d2 N$ U) J& e' Q* G
结果是:) D9 G. u3 f6 V" G1 c* C
result is 2$ t& K, {5 c, t9 Q, B- e
#
+ m/ P; G l: f. G$ L# An unexpected error has been detected by Java Runtime Environment:
3 [- ~. C6 `2 \4 \3 l/ O# N! ?#
0 W; w% ~- S( {& o" }4 ?+ F% F# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10684 |! d* G, {) Q2 a5 s
# X: U$ O+ c8 s- g' r8 n4 w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing): c% o( B; {* P7 ?7 v6 n9 R
# Problematic frame:
8 y, \& m( @! X2 G# C [javaswarm.dll+0xb8305]
6 L- M0 O& \' u) H0 I9 v#$ c! n% c, C; m, Q7 c, U: C8 z7 v
# An error report file with more information is saved as hs_err_pid1064.log |