我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
5 w3 t/ b" k3 s2 limport swarm.Globals;+ W$ g4 c; O; T0 G! J
7 f7 h% S3 F1 m8 \! w
public class test {
% X4 Q6 a# U: t /**
; f) d6 F. r; M6 R3 j0 J * @param args
7 P& q+ x3 D1 i+ h+ Z) d- Q) q */
. J- B$ g. J. K# M- A6 N# c! l8 X; L public static void main(String[] args) {- J4 Y( U+ N" k8 c# L' K
8 S" l- E- U+ Y6 r+ @2 e int y=(int)(10*Math.random()); X! { O3 y2 J1 A# O, |7 \3 \
System.out.println("result is "+y);
/ J9 h- I) d" |) o4 \# V4 Q7 C9 M9 _! ?- w
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 Z4 _; m/ z2 a
System.out.print(z+" re");
0 \. O) n- k- I/ Q% I8 J4 l }
6 X5 K( |1 O1 u( H5 G}
! U% r3 v0 ] K: f$ `' N
N) S; p2 r! M# j$ N5 O" S# t结果是:. R, w* T5 V7 Q
result is 2, a7 F+ E" y2 ]" Z! [, J5 C y
#9 V% z, f! t8 o7 {( I6 R
# An unexpected error has been detected by Java Runtime Environment:
' e) a |8 J5 r( ~7 H7 j& V' T#
4 i# S2 b- R* f+ p% G# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10688 J1 I& C5 \9 l( \5 x
#
* R3 n1 I( p( r% E( d# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& Z) g& E, L; A7 W2 E9 ~# Problematic frame:# e+ t: V% h: h- ~- T. w, h- j
# C [javaswarm.dll+0xb8305]
# |# s A0 ?+ |# U; ~#
1 k; a# T2 O! g# An error report file with more information is saved as hs_err_pid1064.log |