我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ u3 R' c, f5 [7 z! |+ H" ]( mimport swarm.Globals;" I2 _( N1 {7 J- j* S; R, @: k* H
F, i5 f# i3 e2 U- ^public class test {) A1 k. x0 w# j6 N4 @" `! ?
/**
" ^3 E2 _. |1 {8 |7 c9 d+ A * @param args/ E: K) t& C# @- x% K5 b* m( m: `! G
*/
. ]6 t8 P; A! g+ x public static void main(String[] args) {
% `) L! W' {6 x* m7 | & w$ @9 P+ h! v9 X5 g
int y=(int)(10*Math.random());
! i( a' P+ A0 b5 U7 J3 z: u System.out.println("result is "+y);) {- J7 K) t: d- g/ y6 B0 v
7 C. \, J( V, }) K8 j% N6 s, O+ L
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
0 W# F2 _& x, k. g! l) h System.out.print(z+" re");$ X" K8 _8 l0 S- M- F8 v. U2 {
}8 }5 Y" J) v0 H( m- b3 x0 n
}
: }3 u& O& q* g. i, {/ p. _/ }7 Z& e/ }
3 _9 _8 f( U4 | B结果是:$ Y5 \* b) } s2 H' U) h
result is 2) V/ g% F6 u! `7 I2 G
#
. |: o. Q6 C) W' H# An unexpected error has been detected by Java Runtime Environment:0 E* }8 |. _5 C* _3 T$ ?% }
#" }( S* j* S9 ^' M% J
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068) V. B& L' Y. z+ x2 G1 n4 W
#
) g) R( m0 F$ C6 c7 K( [# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
5 V |5 t! F) e, o$ g# Problematic frame:% P: w3 s9 U5 w; @6 {
# C [javaswarm.dll+0xb8305]
5 {5 E7 A" A8 ^$ Q8 N#) K- n" X7 ^& E2 k2 Q
# An error report file with more information is saved as hs_err_pid1064.log |