我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 m: D" J, r" a. b# y2 t0 limport swarm.Globals;1 \' c# O, w5 @' y! |: Y
0 D! c( |( ^1 g( M* E9 x# b
public class test {5 I- h3 `2 j- s. l H( H
/**
; |2 K( n% F6 L8 v7 U# r) t+ o4 V% i * @param args
' b/ R u" C3 y% n */& o s$ B5 R3 p6 \% t0 B
public static void main(String[] args) {% F' O' a; T4 w. }* G! k( \
% O' Z6 `; `$ g( u6 C; l
int y=(int)(10*Math.random());
; z/ {- c" K/ H4 d; B+ \) l: ] System.out.println("result is "+y);) X# u$ }: E7 h; L
" Q' {7 \5 M/ l& }3 g, }
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, s5 b' E( e5 F& @( [1 I
System.out.print(z+" re");: d# H4 N3 t. o7 h* b" G
}
/ l3 L9 ]' y# |) Q7 A0 @4 C5 [}
0 K4 p. t& c% m1 x9 a0 F, z: r6 x9 X- X, y( o Z2 b0 S9 V
结果是:/ I3 u7 F) b" T; h, V5 W: k0 Y
result is 21 G8 b2 N, W P( O: g( E
#+ e D8 \5 K4 x1 ~* A, \" a" E
# An unexpected error has been detected by Java Runtime Environment:5 [. Z7 e( a3 W, O8 [3 o7 _+ Q7 ]' o* n
#
2 o5 \$ T: |1 c8 I- t8 N8 \4 d# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: z& ^9 i8 ^& b: c#4 b) Z* S- m) G) S/ T' |3 t: d4 A
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
4 c- R# ?4 @0 a3 t; S3 j) s$ ]( o* h# Problematic frame:3 _% G, ]. I. V! u# \0 I5 h, X
# C [javaswarm.dll+0xb8305]
/ [+ Q$ s: J8 N$ @" _: T f#& g2 N; C& |+ R7 S9 i
# An error report file with more information is saved as hs_err_pid1064.log |