我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。- P+ m5 V+ W7 }/ E2 o
import swarm.Globals;
( e6 [1 v$ m6 P8 K/ `, X0 l: c, q8 \: {& {
public class test {
( V) x: n! @2 d a! G! j* ? /**
4 t& A# M7 F7 e, g * @param args5 _; P# H Y1 H o' V0 ?
*/
& ]- V' Q+ E$ u7 L public static void main(String[] args) {2 _7 [: w' T/ k1 f" [& g4 e2 i
, p4 H$ v, D* |0 y1 } int y=(int)(10*Math.random());$ W' x. ?1 O) U
System.out.println("result is "+y);
, o4 H. x% j5 l5 N) w$ D3 s9 x" r, ]- B. b& ~
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
2 j9 w$ {; X$ g! M System.out.print(z+" re");
* C( W: }4 g/ b# \0 F& c7 m& @- u }
/ M* W0 P. i, \- r/ c: c( w}
W/ u% |9 h; r2 A- D" _* I, E& j* x* h0 Q0 E: @
结果是:
4 p7 \2 S* E) \" Iresult is 27 D5 G: x0 P( J7 w+ T) w( d q# {
#2 j4 f, f7 C' [% A6 s1 [* h A
# An unexpected error has been detected by Java Runtime Environment:
6 Y @) l+ _; X0 W0 A## f# z) c+ C p7 F" {3 O0 E8 O+ P8 ~
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068" Y% Y: c* j- V, [
#3 z# E6 r9 t/ O8 E) ~
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)" ?# a% }9 t/ g8 t9 g$ s a
# Problematic frame:/ ]2 k3 Y5 O1 f% M" h9 j! V
# C [javaswarm.dll+0xb8305]' H" h0 O1 p6 i2 K* `
## ~7 T/ a K- c3 C7 X, o' u
# An error report file with more information is saved as hs_err_pid1064.log |