我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( ~( \& U- a* O7 y8 `import swarm.Globals;* m5 q5 y) w7 Y, H, s
) ^; X" q$ C! ?; k$ `7 P# j3 @
public class test {# A: u* R2 p) r
/**
8 N1 @' I1 r0 ~$ ^ * @param args
6 T( Z' z. X( m: h- G( \# L1 x */8 k" X. X0 j4 C9 U# y" O% {
public static void main(String[] args) {
6 V% @+ s: i( s* ~* l3 b
- `2 p6 e- f# n& a int y=(int)(10*Math.random());
' t4 u; G+ u% E6 F( n( m/ ~9 L System.out.println("result is "+y);4 J" Y4 |5 [2 d" q' j
& {7 f! L. e9 E7 c" p0 q double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) l) b2 c! V1 S% { System.out.print(z+" re");1 F2 K9 d) p7 J4 j& K
}
) `. X9 ~; v+ c" ~! F4 G}; g6 Z o1 m; E( p: w- n, y
' K: \ j* Q! z- @$ o
结果是:( R+ E1 N& C# \. @8 F$ X; c1 k
result is 20 e, x; H# Q# L2 X& g2 N; K
#
4 M. `9 |' R3 R2 k. [# An unexpected error has been detected by Java Runtime Environment:
8 u* }6 ^ L6 h0 D#( D& h1 P; @4 N0 X- B. K
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
& u( K* E+ A) V( Z p( p3 Q$ q#" _$ @/ k& I5 T, z1 a9 i* C) n+ M/ i
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)! I4 w& [4 x+ y" t
# Problematic frame:+ ?" w: i( X. [. x
# C [javaswarm.dll+0xb8305]
8 k. s& }$ [1 k* c#
: @9 i4 R" ]/ E# l5 W# An error report file with more information is saved as hs_err_pid1064.log |