我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
+ K9 K9 S" t2 D) Bimport swarm.Globals;3 w. h7 Q3 f7 z# F' U. ~" D; M
' F% O/ b. M0 |2 t) R
public class test {
7 F" c6 f: w/ W) K' Q /**
/ G, c8 A+ B' S$ b% ^& l2 ` * @param args- M, w' s* g2 L% w# J; x: @3 @0 t
*/
$ P! W$ ~, p% k public static void main(String[] args) {
2 n( ]$ i5 V! Z- M, E& N) S
, T& s9 e" Z2 X4 o* B8 C$ E9 T' g& q int y=(int)(10*Math.random());
* d" y& x s% ?3 J5 m+ r# R6 _+ [ System.out.println("result is "+y);" m2 B) S5 k+ @$ X- }: G/ ]. L
& A* o- c) \: z5 \0 X
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);) u/ \. w9 U ~5 p
System.out.print(z+" re");2 G9 E+ S' N$ w$ T/ |9 F
}
. ^' p+ {; F2 N; s! E* U}
' t" E2 j" r- c S
8 N. F: S: e, m, U+ s4 S; ? d结果是:+ a( p( m* K ]' i2 u
result is 2
3 F! ~8 y( p: r; l2 d( D' F! P#
/ W- X$ ]: k9 L# l E, J/ t- l0 R j# An unexpected error has been detected by Java Runtime Environment:
8 |9 W1 B6 Y) ?+ d#) u. D0 C; D! m2 A/ Z8 o% n
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068) O: v7 z# M1 o Y* W, J
#
3 G* G7 Q5 r* s/ P x# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
% k4 H; p$ j: V1 x# Problematic frame:+ d" W5 R6 b' N
# C [javaswarm.dll+0xb8305]
, ]6 j2 N9 T% a#/ Y9 x% H: W; ^+ U2 P/ F
# An error report file with more information is saved as hs_err_pid1064.log |