我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
& s# q+ K# h0 }5 y$ \import swarm.Globals;5 w- b. v3 p5 T+ [. S. _% f6 K+ [
5 g0 Z* t- H8 E! {public class test {
( a5 f, u6 _0 r5 W1 m# c /**! Q" J% m2 J9 ^# F, c( A9 @
* @param args
, e5 s" C0 i% Y# o( n( @6 [ */
) _0 T4 ~$ s2 D4 a, F public static void main(String[] args) {& o! u3 X( [& O3 _" f: h
- m/ d0 Y" p. g+ ?
int y=(int)(10*Math.random());
( z& M. x* b3 {- I System.out.println("result is "+y);
2 A( @3 u9 N, {( S
, _, G2 ~: Z1 P: I; C6 o( c& A# a8 B double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 p3 @5 ~3 B& R! K/ f# y6 h6 w
System.out.print(z+" re");9 G w) s+ ]: U* t0 B
}" ]& x9 r* R3 s2 a* o r/ w& h! [
}
$ U. O$ B+ e$ R3 c8 ? J! p5 v( ?; G& p5 l! V
结果是:. s* y7 o7 D+ L6 U- h
result is 2$ C1 Q7 |7 H0 P4 ?7 i
#, }! L, Y* d" c8 E7 b
# An unexpected error has been detected by Java Runtime Environment:# c9 l0 _3 a( r5 u
#; }1 m8 c! z" i* O/ M
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" z( W- E# i. v6 L. u#7 x: R% Z* P$ y3 V! T9 d9 x8 S1 ~
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
: i; i3 u0 o$ `. W c/ R! P# Problematic frame:
6 h0 E& ?) N; ~4 f" P5 F1 \8 N# C [javaswarm.dll+0xb8305]4 m: Z9 p7 f6 t: d) X9 N
#
K& q' V) C1 x* p& }- Q# An error report file with more information is saved as hs_err_pid1064.log |