我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! k1 n0 s2 n0 ~0 l/ Zimport swarm.Globals;
$ Y4 c8 L h5 T0 T' M. j/ p4 ~- L2 Y! e, ~
public class test {
' Q( t) J0 E. c9 y- D' ^' n( ~# Q /**
: c- v4 K8 a, w7 G# N% q * @param args
# `0 t$ s$ V6 q* O+ T9 T */7 K8 u0 z- t. Y+ f
public static void main(String[] args) {; ]: h4 a0 E: P- N, A
7 z" v/ r( @7 R) Z
int y=(int)(10*Math.random());
8 ]+ K9 p b' i s System.out.println("result is "+y);
0 p0 ~9 A, c4 f2 L
: y; |* _5 @4 @) b4 y6 H' A" ?: s, t double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
( C$ o& P, _4 C System.out.print(z+" re");
\$ N+ H" }: L+ X. @/ w* g& ~ }
2 ^/ T/ J0 H! ^# D u}
; l1 [* K# b# g, m9 |4 v+ g
5 Y3 w. h4 `/ ]! a' a结果是:2 _4 H/ t: N' Y
result is 2
) v0 a: n" n+ u#0 P6 J# o: e2 Q5 e( i
# An unexpected error has been detected by Java Runtime Environment:
. o4 o2 B* Y W#
2 N2 l. g# k! x: K- }" l' w# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10687 t9 ^! _, j- {1 M5 b. N8 M5 c: n
#8 h: |, Q( B: S" B3 u
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 g1 R9 m9 U ?& e9 s X8 A/ D. l K
# Problematic frame:) M: ^ q, L! [$ O( R
# C [javaswarm.dll+0xb8305]# _$ D0 f: ?; x k( x0 @
#. I" U/ D4 ]% x% v7 |
# An error report file with more information is saved as hs_err_pid1064.log |