我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。' i* r% Q& Q4 H; e% `
import swarm.Globals;# p% U7 _! V7 K# a7 e; j
" D/ ?% \, M/ E6 H5 L4 z2 \
public class test {
6 s$ u0 i& C+ V+ {5 S1 y- G- {& d /**
7 C" [* T9 U. Q0 B * @param args/ C4 V& T* b" h: l" P1 L7 X
*/( J0 E7 k1 e, i
public static void main(String[] args) {
* s7 Z4 F6 Z ?' |8 w
1 B3 f( O" z5 ~# e- a int y=(int)(10*Math.random());
6 }- l1 F$ G' t' d: x System.out.println("result is "+y);
# h& z6 [# p; i% G) X2 c" z% }! Z3 r$ F% i8 z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
@6 L3 v" O! ]0 Q: ]" d8 H0 F3 Q System.out.print(z+" re");
) `8 R% m* g$ i3 ` }
# e+ i& \8 y! t/ W' q D* @}/ }' [( y* r, ]; p* l
2 Y% z1 b$ E0 i( c) s0 ?1 y结果是:
! _7 @7 D( w. c+ ?7 G) |' w( {result is 2
! C$ u) @/ \1 @: Z' `#% m9 f! Y) P, ^$ R ^3 S' x
# An unexpected error has been detected by Java Runtime Environment:
$ d) O' _0 H6 `+ h, }#5 ^0 m3 x' d& a8 ?3 i; k% P
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068 u* o7 d6 n5 b( ~( ^
#
1 X# M# o c1 J+ M2 S; T# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)2 l0 z4 p; a; S0 I C- j
# Problematic frame:- l8 w! K6 v! h, R" X4 O
# C [javaswarm.dll+0xb8305]
7 y5 h- i* B6 V! }6 l/ ?! T! M#( _5 @+ w n' a- D' t" D- X J
# An error report file with more information is saved as hs_err_pid1064.log |