我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( k3 d* o, |- L& c# Simport swarm.Globals;
9 {* E1 W# M3 t
, h5 X; B `' u: Z% l3 M" Epublic class test {
$ B" I8 ?9 D8 d7 `: S /**
! E9 l t" B6 d1 S1 A5 b * @param args
1 l; A+ C2 u$ `! m% e5 f3 Y+ A */
. Q$ B, ]( h7 n, b4 d/ | public static void main(String[] args) {
6 _9 ` @; e* Z7 K$ y5 }% Z
; {1 w$ e$ A% Q- V int y=(int)(10*Math.random());( ^) q l) k; I8 Y9 W
System.out.println("result is "+y);) ]. Z! |5 j, m4 ]4 T6 |, v
/ q& y8 w$ ^' |) U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 x v! m E/ J
System.out.print(z+" re");: s4 j, l& U8 `' e, q
}
) o) Q4 C) j+ m6 P; X0 c}
# `7 l& o, R5 A) w8 `) N7 R7 C) P
结果是:/ B3 {# }& F2 O% O( W. l$ B" U
result is 2% G* @- H4 S/ B# }7 L) o6 ^
#/ P) t* I, @7 R5 W
# An unexpected error has been detected by Java Runtime Environment:$ o. O, O; r- J
#
; V5 p( M9 e6 t( l3 ^1 S# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! p) H0 z8 E; W8 f; U
#
7 B+ e9 q7 x& S: v# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)- S5 P. Q/ f; s8 {
# Problematic frame:+ a( M! ~% u o" b# n
# C [javaswarm.dll+0xb8305] j# G _- g9 P3 v" V/ K6 D4 Q
#9 I9 C7 c0 e+ k/ h& {+ Y6 U
# An error report file with more information is saved as hs_err_pid1064.log |