我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。2 W+ M- a/ _+ n7 X! S6 j
import swarm.Globals;
4 l6 T s9 c# U. f( ^
! o d! l1 U2 F0 V, Y8 S; vpublic class test {4 e9 k$ p/ L/ n4 i# K
/**
; j9 |$ x: e+ s# K. K9 Q) P% n" c * @param args% K" Z; r- q+ r
*/& N# t% x- K) ~) M2 u$ O' P1 \
public static void main(String[] args) {
: H2 i* z& O; s" z2 K1 L) d8 [ , b- B0 a! R/ v2 i) E
int y=(int)(10*Math.random());
& U7 ~' Q. H! N. b) O# A+ ~5 e System.out.println("result is "+y);
. V" t/ P. g& I% _
( M% p$ A4 y/ ` double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0); t" L/ V& P( D3 x4 F6 t
System.out.print(z+" re");
7 b( u& f5 D- u h* } }1 s9 Z! } X% F- p+ D2 T
}
& X: ~8 X+ I2 r( A! Z1 G+ x" p. r) C, M- s6 k G5 D
结果是:
& ~" m6 w" h% j8 S. yresult is 2+ n0 _4 i9 K* K
#! z3 E2 g" R! }2 r% @
# An unexpected error has been detected by Java Runtime Environment:
/ G( F! X5 {2 b4 w#
# ^1 U3 F$ A( S; A( F# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
, I2 p5 g$ h3 @; [. E#2 ^/ R, g: n/ \) s# ?5 R0 J
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)6 w9 n: n' {+ v+ ~* _: g( f: W" |
# Problematic frame:
6 w# Z& E( w+ t# C [javaswarm.dll+0xb8305]
7 Z; a- I% s6 E2 S% ^* g#( H, S4 H& L; F4 V0 P
# An error report file with more information is saved as hs_err_pid1064.log |