我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。4 j4 D% P- \9 a; u1 c* B4 n' _' j3 F
import swarm.Globals; c% A6 r+ Y/ D5 @6 J& y
0 L# e# l1 h; s+ ipublic class test {! ^( w+ Q! o. x% m( W% w, e- p' U
/**7 x" K; W& Z4 ^. S. X
* @param args
8 \) o( Y" ~, P# I9 B) A */
) m) `5 U: Z B9 r* a8 d" ? public static void main(String[] args) {
8 @$ j0 k: ?! v7 Y( r7 e1 d6 G D, `2 w. R8 Z9 `
int y=(int)(10*Math.random());: [# u% z! o5 A5 y. E! M
System.out.println("result is "+y);
' Q) |2 w7 d& ^, J. m
- r( e& a" v6 e: r# A. l! { double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);( e& X" X) y+ l* h& d: F) ]8 X) S
System.out.print(z+" re");
& o' D5 V/ c/ T6 Z9 Z" d3 S }
; `* Y1 F) a \6 p: P" F+ O}* q+ _5 O- V q0 u$ z7 [
6 l) W1 Y- a& N( u4 r6 O/ o结果是:
4 ?" a) y6 K. } @# e% jresult is 2
! u% Y9 q0 \; k) j0 J#
{. f. o: a7 s: A( P; Y# An unexpected error has been detected by Java Runtime Environment:
6 P# r# w; k: e5 x% z; N! U Y#$ U* |8 f* L3 T! G. k
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
3 k/ P" d) c9 ^#
V! @5 A" K- W4 W- [# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" a# S1 ^( p. k1 b9 `# Problematic frame:' x- T; P+ }5 b( i n
# C [javaswarm.dll+0xb8305]
1 V r+ }: \- R( b" }8 G' M#
. i- K/ z9 | f' d6 I* k# An error report file with more information is saved as hs_err_pid1064.log |