我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。& v' s9 t" B/ B
import swarm.Globals;
: t! c4 X3 T; U3 }
) }! ~9 k/ q: i7 S$ U/ V" L' tpublic class test {3 ?! }* R" s& f' |9 E0 i
/**1 T- g/ X- ?$ O
* @param args/ ^8 `! q4 R( I3 C& k9 i
*/* j# {& Z; Z) C+ {$ G3 p( y
public static void main(String[] args) {6 o9 O' ]% f7 b$ {+ n: x
0 J! t: w. n7 x, }$ { w int y=(int)(10*Math.random());, R7 D* H b- q. g0 H
System.out.println("result is "+y);
: i8 m0 E" y/ R' m8 C9 K6 b
- H0 V! N. e S/ Z9 N4 U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);' {$ T4 v, b) n) W# n- R+ C
System.out.print(z+" re");8 E# f! Z/ D: w) Y# j
}# h$ B" B" S) c- Q* ~: a
}9 q H: w$ l& u3 d
. d X7 O. U* W结果是:3 c6 t( Q, }& L( o; g# T# ^( o
result is 2( j; u4 ~+ X% d( b. {. M0 `
#0 g/ \4 y% @ p8 @# B
# An unexpected error has been detected by Java Runtime Environment:, T- N. ^1 V+ Q) U) s" {5 l B
#+ |+ E( b7 V! ?/ J" F
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 T4 m6 u, S4 `
#4 W/ l3 ~ |$ ?" k
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- Z1 F, B; W' t( a3 H# Problematic frame:. }% w; y8 {- M; D9 Z3 i3 }! B
# C [javaswarm.dll+0xb8305]
& G" Y/ P( B5 ]#. o/ ]/ l3 G% H$ P7 d S0 X
# An error report file with more information is saved as hs_err_pid1064.log |