我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。" c. X) l ^- B+ X5 ~) H2 H
import swarm.Globals;) I5 a1 a- i, t* @% M7 ]# k$ v
* Z1 p% [6 E B/ R* r3 n
public class test {) D# t) c2 N/ }2 q" E1 A8 Z
/**
5 E: t) }& E; J/ Z! b * @param args
8 g. H2 |3 T% ^8 ] */7 b+ f! d% F6 I- x0 \$ `; R" s, [2 f7 U
public static void main(String[] args) {% S: l+ F: |4 p3 v8 V3 p
! M( T& M" m* w7 ~" P! u
int y=(int)(10*Math.random());
6 m$ r L) Q- a7 T" x8 j System.out.println("result is "+y);% q8 z2 k, b3 f+ c
& y. ~1 G0 I [3 Z+ [" d' Y j- m4 H S double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
3 [' E8 K' ? _ System.out.print(z+" re");
2 w6 i, O' u$ Q. G, E9 V. N5 C }: D9 K+ h8 {+ D# r: h9 i0 p5 W7 P
}+ E" ~) `' m+ V) `5 I
% u$ A7 z6 i2 V) ~4 J* \9 H" ]0 c
结果是:# I, l$ T/ o0 k( L
result is 2
1 s% r. `( `1 t3 O$ {#
9 g# y2 w r* G0 Z) j# An unexpected error has been detected by Java Runtime Environment:6 `# S. V6 y4 e2 F/ |" f/ v0 y7 @
#
) I1 j$ _- ^' x6 q- y7 s, y# y; m. W+ G# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
; L+ B3 B. L6 q c) ~1 t5 x#+ m' ?0 b+ G, @6 `
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
f5 L L V! `. x1 o Q: G$ u. f# Problematic frame:
2 \% ^( Q. d6 m: s) h0 t# C [javaswarm.dll+0xb8305]
( p7 w- R- s7 v5 V# b; o% R1 w! u# ]#$ A8 y! j' ?. q. c1 d: s6 z
# An error report file with more information is saved as hs_err_pid1064.log |