我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
/ O B" W g2 |, p1 b& G0 s, S9 Cimport swarm.Globals;
9 k1 W4 u- \" ^/ @5 b7 U6 _9 C2 G" m+ I. T1 z f1 M% V! @
public class test {' d* d' e; B0 R$ B: a
/**
" d0 K0 ?0 P' E0 {0 T% U7 f * @param args" s; W! L. v4 D0 U4 i* L; T& I9 A
*/: n' ^, C. P' O% }. R
public static void main(String[] args) {
9 z1 [& k- J. L5 H 2 m# s- P* G i/ w1 a* s& a
int y=(int)(10*Math.random());
) ]+ I* I x8 T& q2 i7 V0 X( H( e System.out.println("result is "+y);" A5 e) Y& h5 W1 L
8 E, g0 o1 G# q% i* t+ c, ?& U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
/ H& k* k, ^; b( E8 x, } d System.out.print(z+" re");
8 q/ _% D8 w2 Q, v# p! ~, B9 { }
- G3 {7 B; i4 w. H: N: F( J}
7 [% i# l; u+ K/ u$ ]
! n! n7 H" q7 ] q; C$ W结果是:0 d5 w$ t7 F; v9 ]5 ]* f6 A
result is 2, W0 `6 s* ~, t2 ]8 [6 E
#3 X& k9 m) A/ f. Q0 [0 b4 ^, E* {
# An unexpected error has been detected by Java Runtime Environment:
0 Q, t) m8 v2 Q. t#
/ O8 C" ]1 y, ?$ z1 f8 g% `6 Q# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10682 M) [8 u6 ?4 t" O1 n E
#( _# ^# p& s2 R: d1 b) [
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ O) r! g! X" p6 m" k: L3 g# Problematic frame:5 u" U" y- h* q- D+ y
# C [javaswarm.dll+0xb8305]
& o2 k* K! x" U#
4 I0 n% `8 C/ c) h9 n& ^# An error report file with more information is saved as hs_err_pid1064.log |