我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。6 S3 \# p- s: A' n- y9 c2 _, @
import swarm.Globals;. _ h0 \, p) `! D' d* c
3 |, m- K! z( y: Z* I: hpublic class test {: }9 t1 X, u* h$ }9 W0 c5 q
/**
5 X" m7 e; k$ }5 U; m" C * @param args
) Y5 g5 u) j& o7 K9 ]7 r; ?: t */
/ N, o. j' R1 j1 R public static void main(String[] args) {
: d; j9 M/ b. l $ l/ |* a+ x2 O9 t' _) S
int y=(int)(10*Math.random());8 j6 V! A( G) l- \1 e1 F( B) L) p& J D
System.out.println("result is "+y);& U* I8 l1 T% x% N1 X! X v
3 Z. B( A# |# j8 l* i) ]& Q+ u
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, j9 ?% @. u6 n/ H/ s
System.out.print(z+" re");
/ i7 U# c) T! `" G/ X& C% _ }
3 Z9 f' G7 A+ N, k j) j}
5 Z. _$ d( Q* i# Q @; K
3 o7 @) N W Z' N% O- S, l8 U结果是:
$ V9 x E! Z* _' a6 H6 fresult is 22 P0 P6 L5 `/ x: Z7 @* F5 _
#
& c4 T$ Q( A& n1 K+ m# An unexpected error has been detected by Java Runtime Environment:
& i; J+ d2 a8 M% N# _: Y7 m+ ]5 R
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
u9 W9 y2 X. H- N#9 s0 R, D, f$ h4 ?6 L
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& K/ f M; k% w5 u3 Y) ^; W: R
# Problematic frame:
f+ F* M, Z; ]; L; M, x _# C [javaswarm.dll+0xb8305]0 M) l. I2 B* X4 ^3 ]
#
* o: C; k# H1 W7 e. t k# An error report file with more information is saved as hs_err_pid1064.log |