我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
8 V' m/ L6 q3 W, c' ^% Ximport swarm.Globals;
- n- s2 k( \" g- L$ ^4 g: S( ?+ e& v: O8 g: t1 H0 K
public class test {* W/ K7 G* ]2 ?' h# |
/**
* R0 h6 s) q! w! h7 n0 I * @param args
- Z; g; g$ Q, ?/ P; l. R# T4 R" n" o */
5 A: n" Z ^4 U: ~* x1 P public static void main(String[] args) {3 G& @7 K# o3 w' a
. w" R: ~4 t4 o$ G% i0 p
int y=(int)(10*Math.random());
5 C6 q0 u0 o2 s3 }: h5 w1 [ System.out.println("result is "+y);# j4 k9 a( e! i# o' f
/ [8 V! ?3 a4 B) s) J double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);. I& g" Y6 `* e: l/ I3 [7 P
System.out.print(z+" re");
" t% q+ j) y% C8 d }
" X& O+ T1 c! }2 s0 o8 N7 N3 t0 i% `7 a}
! H0 q! X7 c% y1 G6 m' O
+ g9 N: [% O! G结果是:% d+ V7 D Q/ X* |2 k% C
result is 2
: G0 v7 [" V% f( P" J## D$ W6 _% C' R, N& J& v% h6 k
# An unexpected error has been detected by Java Runtime Environment:2 k: Z H& \+ E0 K+ t/ s/ l/ K: d
#, `) N: W8 W" Q9 n2 U) k
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
1 c& h% l+ i7 k3 A9 k- X( w/ W1 Y#
7 X: Y8 i8 E9 J# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)+ U4 t! b( {, V. [$ j
# Problematic frame:( R' A D% m4 `$ e# k! o
# C [javaswarm.dll+0xb8305]
' I2 v/ P- G! I9 Z2 ^#
, j/ H5 d0 E8 ~# An error report file with more information is saved as hs_err_pid1064.log |