我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
4 h2 z+ R, r: w6 B- dimport swarm.Globals;
9 j, i ?5 {% I3 i: a9 V6 I1 [; T @- T
! J. A5 p+ L; @: n9 j2 I* I5 S* d4 wpublic class test {
; M3 X* r0 M9 P' z2 e I; @& W8 l /**& f; c5 u3 K3 w) Q
* @param args( y' T: V# |8 `/ `
*/
9 L, c6 F" C" `9 k! M) Z2 c: i public static void main(String[] args) {
7 T& Y) W2 K9 Y9 Z. p
( i2 S( W+ s# r* p: n' @ int y=(int)(10*Math.random());
7 ?: w* P: e2 U/ X System.out.println("result is "+y); y1 I' g* b% I# X8 p2 u
+ h1 j" q) M( j5 \9 z& [3 P% o double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);6 C1 H- S2 L: M+ @
System.out.print(z+" re");& I m/ o" |6 \6 T U: N9 j
}
r; S# Z2 A; K S0 x& R5 W$ |7 O}
- l. F" K2 w" K9 A5 S5 A Q3 G: m7 W5 Z3 H/ ~
结果是:
* L- f4 {+ T+ Dresult is 2
- U8 _# B9 v2 `#
" m! C6 w9 @" l: V0 \# An unexpected error has been detected by Java Runtime Environment:/ T+ o2 _* {1 s( N: n9 C
#
* W) ]- G( x: b9 h$ x6 E# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
+ _ o+ S. w) ^( J0 I#
2 b; ^, w3 R* G- t# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ [$ ?) t' `2 M) \' m! n" M# Problematic frame:
) X9 d7 R! Y: l6 w) ^8 e; P# C [javaswarm.dll+0xb8305]
9 H Y3 e" z0 b* r0 k' e9 }#4 |& @0 D7 W9 ~' g0 |, {; f- U0 ^2 Z
# An error report file with more information is saved as hs_err_pid1064.log |