我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。; M: x3 _% }6 J. q8 z
import swarm.Globals;' I* R' \& \9 P' C9 V/ j
. h5 E/ d6 b( r0 w, x( A* gpublic class test {
: B1 {% q ~, ?. Q9 u$ @, W J /*** p8 E6 p# a7 S1 e8 g
* @param args
* \$ w3 U( j5 a2 N* D# X7 b */9 b5 T4 P+ W: m0 Q) o
public static void main(String[] args) {
. ]% o2 a9 p1 j$ w3 F3 X ) H0 t7 @* S: I" _) ]2 |
int y=(int)(10*Math.random()); Q) t5 P, N. c5 P- q2 X
System.out.println("result is "+y);& _* q+ V1 @* B" W3 V9 t4 S
" D1 J) P8 O1 @1 }0 w, ]: B double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);5 D* k0 ]* m U$ j1 S& F4 w/ @
System.out.print(z+" re");& e& P/ ~+ T. `" U: z
}( o+ Q2 z4 ?+ l+ W" P
}
/ R! g( N# X% `1 Y" m, b
% W) v/ H' b. F+ {/ I% k) U结果是:8 @- J5 a# @2 i2 u, n
result is 2
! s! a, g* n9 s3 }7 B#
3 d& K, N& B: l$ {4 m1 i# An unexpected error has been detected by Java Runtime Environment:
0 J; p' }; F3 l) q+ ^#" `% ?' A( m) r1 x( e" j( y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10688 R4 J3 W4 D6 b8 B$ \1 r& E
# @7 A1 Y' W- `5 w6 q! O; j+ q
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ e' S% I1 O4 d4 C
# Problematic frame:1 h% `1 {, S' r) @* T# H5 c
# C [javaswarm.dll+0xb8305]
6 f5 r) d" [" t& p7 R#
2 l# V$ e3 R3 z( K+ Y6 {4 {- q# An error report file with more information is saved as hs_err_pid1064.log |