我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! t- z! P. W/ f7 Nimport swarm.Globals;% [2 Y# I+ r0 Y
) v1 B. A' `8 V
public class test {
& c3 i- H A# y# k+ M7 g /**
% y. @7 @; f8 F5 V * @param args2 B: B6 P1 d2 c% l
*/
1 r6 [3 ~* h& K# B' k public static void main(String[] args) {& T0 Q0 [" I8 {& F% m
& I/ R: b5 b. r2 v: J
int y=(int)(10*Math.random());" l/ G4 d1 z# D% P1 Y
System.out.println("result is "+y);
& @# H' ~6 J5 |1 {" a z. J9 o5 r0 T8 Z6 g% H6 }3 ^
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);) t* e N7 Q* q+ M0 H# t& g
System.out.print(z+" re");' w$ k R' `0 W; W# K' n" m% M( A8 S
}
$ S* G% w8 `! \& ^}
8 L7 d; g7 W7 f9 |
3 |* F' a2 c7 g结果是:
$ G; k2 {: B, ]" Cresult is 29 _+ {/ z2 T4 U9 p
#
* ?" F( D9 O3 V* e! X0 D0 b# An unexpected error has been detected by Java Runtime Environment:) H! m0 \7 t' R$ C6 }9 s# j
#
5 l+ r2 T$ U& I; K# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" b/ D2 [/ O2 _) V8 @#
% Y, U/ r; y1 b& `9 O# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
, Z& n) K% T! a3 L4 q# Problematic frame:2 L3 c |- t7 W
# C [javaswarm.dll+0xb8305]5 [! ~3 C2 |% c2 p/ Q
#) B k! q1 `/ C& }% K% n* f
# An error report file with more information is saved as hs_err_pid1064.log |