我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 {" p9 S9 ^ W) R$ @$ L7 Q( Fimport swarm.Globals;! F. S4 _6 B# T; J% I$ n( R
- ?# t6 c# M% i& Q% c8 L" Z3 apublic class test {
; e/ s n1 t& h. S) ?4 r /**
; i' r" L$ Y) E6 C * @param args5 w$ L' k5 T( F" N+ N+ w+ w" z
*/7 I+ q- R, p6 I4 ]: y, J
public static void main(String[] args) {. g- G4 t2 O3 `* a
+ h9 d/ r! |; Q$ g8 i
int y=(int)(10*Math.random());
5 w0 F; P, J5 s7 ? System.out.println("result is "+y);
/ F2 R/ B2 H% Z% m! H) f w8 S' j5 ]
$ e0 H9 I* Z# Q- d7 U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);" M. A" n w+ R# k8 u( A+ }
System.out.print(z+" re");
# `8 F2 N1 S/ A3 c( O }
; S2 D$ n/ b, t# b}
' B3 X. K/ A5 A# ?+ v" ?$ a7 w) O; g
3 q q9 ~+ d# T8 |0 D) E: ?7 G, g+ l结果是:5 d' a8 V2 ^; y+ C
result is 21 G+ x3 C8 u5 M1 ^
#( }6 C7 ]% {. ?' I$ j# Z
# An unexpected error has been detected by Java Runtime Environment:
* ?- V) v/ Z$ s- R7 e- I( V#
; a2 X* f2 p! o# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068; J+ j ^. P' H7 D7 u6 s
# |1 S5 K* V, Q7 a$ U9 E; n" k
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ L* E$ R) T1 q1 j* K
# Problematic frame:! \; o" s! u; E; c
# C [javaswarm.dll+0xb8305]
7 M1 H" ~5 L+ b#- b3 \6 q2 A) V# P
# An error report file with more information is saved as hs_err_pid1064.log |