我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。+ t Y* K2 X, z" `9 s4 m4 U" e
import swarm.Globals;$ J. M, r+ |5 K) m
V7 W, ^+ w7 l! W
public class test {9 h8 p: W) B; ]1 O0 [. x6 X5 w
/**3 }; v w( X$ ?
* @param args
& d8 c6 o5 A& y+ w! n */
. H8 E' {: A5 h. a7 _/ I D public static void main(String[] args) {' s/ R* f; O; @; y, y
# X; V Z* Q8 ]- C: }7 b
int y=(int)(10*Math.random());
; g& U& G; R7 O$ T System.out.println("result is "+y);1 j O( V3 o' G9 t6 r; D. y, m
" k3 }$ |$ _+ i5 u/ a
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
9 z1 Z6 E# X* O System.out.print(z+" re");
5 z5 e: ^: I: [- l; Z }
* s. m- j# I" ~* ]' T}+ P; ?' \& ]. x2 c8 r8 Y, I: ?
; o* h( `. E/ T) j结果是:: o8 U% K! N+ Q' |4 y
result is 2* ~* k5 ^. k3 x: _
#! a% B- O$ t9 i; P8 V) m3 y( P
# An unexpected error has been detected by Java Runtime Environment:& C! y9 ?. B8 P
## G* |$ ~) u& W/ x/ D
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
+ m2 b ~' y/ S5 [. i }#9 r5 P& Y% ^) U% j/ ^) d
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 {, r) ^9 J+ X0 `5 B2 T9 w3 \0 u
# Problematic frame:# H6 I R+ |( E- K f
# C [javaswarm.dll+0xb8305]
% T% Y5 _- I6 g' W& \' `#
) A$ G" D. }6 s9 F; }. m% j# An error report file with more information is saved as hs_err_pid1064.log |