我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。- x- _) K# |' g: Z" a( t
import swarm.Globals;5 {2 ^' P0 |" A. j7 l1 C5 u) D
0 D9 j& S8 [3 F) R8 ]7 B, `3 Z# ~" n& h- ypublic class test {1 B* M8 a% o6 M* @* [. B) \. c' b
/*** [; w! u6 r# P1 V, `
* @param args0 A( p R7 d4 L: r; Q; h: D6 R
*/
# I1 L! L: E& l public static void main(String[] args) {
, ]5 P* d& `6 B
' g% ~3 j1 s- Q+ B2 p int y=(int)(10*Math.random());. ~) Y/ } [, l* g1 R; h! g
System.out.println("result is "+y);) i& m7 l8 `6 {) G- F, F( ^
; r2 @- P* ?# c4 f/ L f
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
: |$ A; Z8 p: Y; L! B0 V System.out.print(z+" re");. ^: d/ G9 b, N+ |
}
7 E6 V3 c$ m9 G5 s" f: l$ E0 w} x, _& R# n/ H& p; i! R
9 R3 Y& f y( i& f结果是:
0 H' @, H0 b, R' x/ nresult is 2$ e P: q9 G" K! J% k
#
6 {5 G e: E# Y4 a7 P# An unexpected error has been detected by Java Runtime Environment:
+ M3 k) W& J3 H. i/ x# E9 ~#& P" r8 n( d3 \6 F9 Z2 d
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: Z0 H$ ]! X3 U$ \7 x$ I- N#$ W' p4 @; J) w8 \! j( G1 M# j0 b
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ f+ p, o/ z! }, V( Z( Y' P# Problematic frame:+ F0 i+ p+ M: d4 @
# C [javaswarm.dll+0xb8305]4 U) [0 x: @) M) e+ Y+ [
#/ ^- c- z7 _# G7 S; r) s3 g4 O- G
# An error report file with more information is saved as hs_err_pid1064.log |