我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。/ A4 e$ k: F9 K: O. g
import swarm.Globals;
: Q. {7 z/ I7 R; s
% D# p" U3 S+ b0 m5 i' Wpublic class test {4 i' R+ G3 r- q* z
/*** T; O8 U! [# N
* @param args. B" ~" X3 g- g
*/" H. V& R3 p) m, B: X# K
public static void main(String[] args) {
3 i( d3 p. m+ [: Q b% m
, E1 ?" m& Y* } int y=(int)(10*Math.random());
- ~: h/ C( g- G) o3 m9 d; K: X System.out.println("result is "+y);
+ C5 F% A5 i: D }; q/ T1 i
" d9 _; R4 Y# \/ ]7 b double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
& Q' G2 c! n% z8 a7 d5 n System.out.print(z+" re");8 k0 I8 T5 D1 v3 B; O9 s/ e
}
! l* W/ B3 \4 Q5 y4 T" X}+ D; ]8 D2 |$ x8 H( M
( m1 k$ V& u" W% n$ S0 l0 c% I$ J
结果是:
+ B0 B) g+ C) P% ?6 Hresult is 2
1 R+ x% i* u/ t#
3 Z9 a" Y5 }7 d) Z) z# An unexpected error has been detected by Java Runtime Environment:
% @0 Z( V# f- V& g# `5 {#6 O( h0 B* e9 d5 w6 c1 M: X
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10685 o2 W8 V- S3 Y4 w; p }
#
0 _9 e# y0 j; ]( R# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
2 ~; d- b( q" U3 }( q# Problematic frame:
8 X. L6 P6 c2 E/ `, F! L# C [javaswarm.dll+0xb8305]! X* o6 s- @3 ?
#& J: T) x/ o2 K: G) V( ?
# An error report file with more information is saved as hs_err_pid1064.log |