我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。" _9 f8 @2 Q, l& Z* a- a) W
import swarm.Globals;
4 B" }6 k+ E7 }
/ _! B( ?- N" \7 l& f1 Tpublic class test {
7 a% _8 y9 l; d5 J' b2 b+ }' q/ b /**
8 g+ p+ t B0 H( y y * @param args* j$ y+ Q- Z% g U/ E
*/" S( C, C* |8 b# k, K
public static void main(String[] args) {; x" c4 J) ?" [/ A6 O7 D
5 ?0 z' m- w8 H1 t o
int y=(int)(10*Math.random());" X6 H/ q1 D( J$ b+ ]+ _
System.out.println("result is "+y);( `! C2 ?2 z! M" l( j& [
- m: l+ ?( t, l5 D8 f
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
3 ]! _" @0 ?) E' n& W' V2 o System.out.print(z+" re");
* c9 Z# h8 n: x, g" L. J5 U }4 A3 W5 ?9 U q0 _1 X) S8 w
}
& S( @! U% e& X, D& W
! g8 R& R+ d; Z* q9 Y7 s( g% B: T结果是:
* V6 M* S. z" S) Nresult is 2# {" p, e0 h& S9 R0 f, v
#7 m) G) a. }0 ^' K# b) t
# An unexpected error has been detected by Java Runtime Environment:
- E! C9 C0 W9 ` U2 v1 q/ ^: |# r#. D' {7 h" T5 Y2 |8 q8 G
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10685 M$ D: y' }- `1 p2 W; ^1 X
#
% K5 P: S) M9 a8 J* O& W9 s# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( m1 F X3 N- r9 I% S9 @
# Problematic frame:% R4 L- ^) }1 e3 P, F7 P
# C [javaswarm.dll+0xb8305]2 h$ K5 U" v$ j. S2 D1 b- Y6 Y, E p
#- _7 l5 l( @0 x( v9 t
# An error report file with more information is saved as hs_err_pid1064.log |