我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
# [0 x* z( Q& N/ G0 q Pimport swarm.Globals;% c( |3 _; ?( G X6 } K
5 H6 X3 ~3 F) x6 p% ]# J
public class test {
$ _* G5 g }; b. u: M1 g" A /**9 e7 K6 o K! @+ m# g
* @param args; z6 v: h- X* m. b) E$ ]& S! x
*/
% z; E! c( M5 F% L public static void main(String[] args) {
9 k( w" X" q5 @5 t( L t " G0 A" `% W6 H
int y=(int)(10*Math.random());
8 b) w* x7 d. N2 K0 O5 \3 V System.out.println("result is "+y);
- u8 d& p+ U4 H- X Y
; v. E4 Y' w! `6 I% ]5 [: \+ O double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 Q, m b D1 h7 v& A System.out.print(z+" re");
# m2 B* z% k8 _$ g1 X3 s! j& U8 s }9 `# n- Q( j# P4 `. A" U% s
}
$ {5 K) _# b+ @) l1 [& R& t& a$ L+ x) J, B0 B
结果是:. b: h# E3 ]+ ~' z0 h1 V
result is 2) O \# A$ B7 g" m/ W
#
+ {7 y1 Q, M, C( Q6 f3 h# ^9 Q& A# An unexpected error has been detected by Java Runtime Environment:; F$ C% M' o: U9 M2 [$ D# I
#' M/ G5 [# d0 V. a3 L
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! o6 |, _7 F( m4 I
#
0 `; _* y8 f3 V. P, q# Q# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing); F! w# \4 @ S( ^0 h }
# Problematic frame:$ e2 }, i7 ?8 V4 W3 S1 V1 H8 ]
# C [javaswarm.dll+0xb8305]
! b4 [( N2 \2 X; M#
/ D7 v1 W$ O/ ?* `% |% r% H# An error report file with more information is saved as hs_err_pid1064.log |