我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。. R) x. d% F% ^ H8 t& t
import swarm.Globals;9 Y! o1 R6 ~, ?9 R- G3 C& r; l' h
2 p8 m) E+ P- `1 `9 Rpublic class test {
, O- [! ~3 B. P/ f- ? /**
2 Z# c# k+ C2 s$ Y * @param args% l- ^' C1 c. d% N; M
*/$ x7 l1 I" `' P" C& |7 M8 {7 [
public static void main(String[] args) {' Z$ E" J) X( X" U9 M4 K
& ?: X- j4 D" U! j g int y=(int)(10*Math.random());
! @/ W9 U/ q% S+ U# y6 ~ System.out.println("result is "+y);
' q: P6 V ~: _7 V" r% Q1 ^
5 L; x: @ q0 T a5 b. D. A0 B double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) r; ^+ _0 Q: F$ q) [- A System.out.print(z+" re");
" |% y) p( c6 O1 m5 E }7 X6 l/ @( |1 S7 q
}) M3 m u0 p' M: G1 R9 e# R
, ~' u2 d% |+ I& V5 A
结果是:5 X. P F1 ~- z- h Z
result is 2, D2 c0 ~: @" G( \5 P
#( s) J! k2 F* v( s
# An unexpected error has been detected by Java Runtime Environment:- T8 f- V& Z$ k2 X! x
#
1 ]' c* \! c ^) E6 P7 l# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
, h& u [5 j7 D* Q6 u1 }' T/ [#9 \2 ]6 k2 v& w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)# X/ h5 @1 d5 I1 R: y( _' P
# Problematic frame:
& A# v( |& m, N- ?$ M6 g0 q, h# C [javaswarm.dll+0xb8305]
, S& _: e. _% V- x3 Z#5 B8 X* I& Z- I. c
# An error report file with more information is saved as hs_err_pid1064.log |