我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 e$ r" q) k2 G8 G8 U% fimport swarm.Globals;
p* T/ e4 x* F' m d5 [& u8 V
$ B7 ?8 j2 m+ `5 h: Vpublic class test {4 R8 w0 W. ~( d# y# o0 q
/**
" x _3 A e8 C8 o1 X * @param args
% r) [' l8 E9 f3 i */6 M$ C& q* K6 d2 z0 D; Z* s1 t
public static void main(String[] args) {
6 _2 T( [( W! n3 Z1 d/ q t ^
2 f: y: d7 b* S% E- H" g9 Y int y=(int)(10*Math.random());
, b& B8 a, M* b! {. X2 u# ~ System.out.println("result is "+y);" y0 p: k! O7 A1 | ~% T
# M6 C8 f, u5 b5 v" @; y: o
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);7 I; \8 h- s8 u& j# o* b- {. z0 }
System.out.print(z+" re");9 E4 K( I* A. m* l- D+ [
}: h% P" m, g2 ^/ z
}, j; H# o, ^. J" @
3 @: O2 B2 g2 i7 `0 N0 M
结果是:# j% ^' E) Z( f! H$ M( z/ C
result is 2) q5 g* o8 ?+ M+ v
#, F! w) U# A9 ]9 r' ~) V/ i4 B% B
# An unexpected error has been detected by Java Runtime Environment:
) s; |! m' `) ^( N7 U* }- P#- I4 K+ \$ M6 p Y" T
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 q( N; z [" N( F v, X6 E
#: `6 T: F' H( ], k! u% T$ G3 M7 ^
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
8 ^$ M: ~9 a6 w8 g# Problematic frame:
( e1 P. o5 V5 S# e5 d# C [javaswarm.dll+0xb8305]: x$ y E( |: R9 C9 K( ]- l7 _5 {
#
' h9 V4 F5 e0 ^) x5 a8 u' r# An error report file with more information is saved as hs_err_pid1064.log |