我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。2 q8 W+ W" Q4 m
import swarm.Globals;& S! C7 N' X( r( V- H, Y7 q
8 B. B! P; O; f7 |5 h. q0 Spublic class test {' p, X$ b. |1 [
/**7 d' R6 J$ T& A: Q
* @param args
1 m! s A! \1 \2 {3 S5 W0 j */
; f+ \5 a2 ]2 ` public static void main(String[] args) {
4 D, i* R4 g- s6 T
9 U5 s9 E% _% m2 ~6 W" `* y4 x, | int y=(int)(10*Math.random());) G, T* Z# N0 Q
System.out.println("result is "+y);
7 p( b6 `; m; ]8 t4 @8 h# Y% w0 s
) ~+ V; @ ^8 G m% c5 s double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ H: t; t9 z" f% \! s7 y
System.out.print(z+" re");
% |; O0 G5 t( f( b }5 ~4 X' q! X P8 u) I L
}* F+ W! g2 U3 D. G3 I2 N; k/ ]
3 x# N( M; i) n; `# Q结果是:0 b* S0 J7 a9 h f4 U6 t) ~
result is 2
1 Z" f S2 ]5 u7 O#6 F/ e- ~- E r" N! ~5 d! T
# An unexpected error has been detected by Java Runtime Environment:$ B0 C3 J/ ^ {" U3 z0 n9 ^2 u
#
1 K% b( V# H; |; y$ j/ Y# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
/ n( H. Z" c0 V ~; T8 Z' D6 k#! v$ V( }7 [" g9 V) f4 f2 Y& Q9 A
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ ?) Q$ w9 `! f: x) h: D( r0 B
# Problematic frame:
: O3 H) B6 T2 i- }% B' _7 {# C [javaswarm.dll+0xb8305]
- f# ^& R0 I- b8 |+ y2 B+ c/ F#6 Z% b# H7 a ^$ U; M# ~
# An error report file with more information is saved as hs_err_pid1064.log |