我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! z: f; q2 |9 b( ]) fimport swarm.Globals;$ w. N; l6 q: F, h/ e
9 H$ S* b$ S& K5 Fpublic class test {
1 S: d) w. S* @ /**
% U# a0 _6 ^6 M+ |' l * @param args
" g5 Z5 l" a4 U */$ q7 j- F1 F f M
public static void main(String[] args) {, T. H G6 z* w6 y8 E5 H9 J
2 g- j* }' f$ z
int y=(int)(10*Math.random());' m2 v; U9 \4 s1 X% N$ p& T5 b& y
System.out.println("result is "+y);9 T2 X4 K( u9 T
$ \* r8 b n6 R& y7 y
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
* V/ ~- k+ C+ _9 M. r; c8 A System.out.print(z+" re");
9 c' O2 Q& k) U) w. [1 D; j; G }( C' M7 M# u6 F3 L7 a& @2 j
}
3 c( T9 V% E2 T3 [& j7 c, ]: \: b. w+ T& j( q& O
结果是:" \3 Q7 S5 z0 e; M) X
result is 2
! r/ j* ?# R0 r t4 }! w* `#
0 h, |) q9 z4 N/ z) |# An unexpected error has been detected by Java Runtime Environment:5 k$ `6 s1 L2 {# R7 M# Q8 E, ^9 i
#
; x, h# `9 Q, O# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
0 o: c) R- [+ S) j" @- K, }" R2 E#
9 E7 n& y8 J) ^3 Z" l8 l# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)8 Z- a( y1 x1 S* w/ S5 y4 A
# Problematic frame:
$ w$ U6 B, R6 y# C [javaswarm.dll+0xb8305]
+ j5 x% B" O1 U. c, a; j# [0 Q& s7 h8 @7 M0 M+ u) V
# An error report file with more information is saved as hs_err_pid1064.log |