我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。2 I" p) M5 K+ L& E2 x! J1 N
import swarm.Globals;
, z- h; ]& A! D- g& J x" H
, ]9 K0 j% ]# i$ \$ v" Opublic class test {
% t3 Y" t4 n/ G9 Y" A1 I% {2 D- ^" W /**
6 ~ }* Y5 T# ~: w * @param args
9 j8 f' r3 Z7 }: K. z. { */
5 I7 S% T& w* J" u& d public static void main(String[] args) {
1 G6 Z4 M& I+ i0 R5 `1 x% I! N
9 X4 C8 q2 V& G$ w- B, ~ V5 ^ int y=(int)(10*Math.random());
5 q" Q; L* ~; @+ z% q+ @ System.out.println("result is "+y);1 G% u, {3 F% c( d0 p5 s2 T X# ?
+ y3 w* t# j2 S6 s" z0 U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);" }( d, A9 P% V- \
System.out.print(z+" re"); s( @. |. @$ ]0 U6 c
}8 @8 a! M' k0 b! \9 E
}
) g l9 P# r/ S2 Y& R4 d" i
. R, ~( ?1 j$ ?结果是:
) N+ g! m; c4 t( E- b* q tresult is 2 p9 {3 @# h. \/ t! E5 P
#* k3 H* R0 u, o2 e3 E- s
# An unexpected error has been detected by Java Runtime Environment:2 | q% D$ x5 }* a5 v7 `# Q
#
! b" Y2 l7 x% ?. [, G8 r* F: x; o6 `& U# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
' j( r+ j( x7 m( h. n" @" m+ e) l## q! `0 g, m' i' U! \9 ^; q* N# l/ J
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
) S8 Z# Q( s8 o* L1 L7 q! n) ] A2 G# Problematic frame:
' T8 D% c9 O$ }* {# C [javaswarm.dll+0xb8305]/ x3 U2 f1 N, U" L+ [
#0 r& d% `, y& `( Q7 j
# An error report file with more information is saved as hs_err_pid1064.log |