我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% P, s/ k+ b$ _( p/ cimport swarm.Globals;
- X9 K: `5 b0 P& y/ h/ }- o- k4 j+ l' y" r# t( i
public class test {
8 U0 f+ ^) t( O( o. y* f4 j /**$ ~, N; f7 k$ S7 z! x4 f/ _
* @param args9 N3 g" @# J; p- t9 z+ H- H
*/
% x- g( _( @7 F public static void main(String[] args) {
2 F! o) j- I& y . _7 k8 h9 k) w) B- W
int y=(int)(10*Math.random());
" ?+ t6 G$ p+ R8 X/ Z System.out.println("result is "+y);/ \$ J$ e5 M* ~( q7 |* ?
2 }$ A4 R% G4 o4 K* a6 G* }. d
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 |$ {' p, j5 ^0 D" D* l
System.out.print(z+" re");+ i" T5 z" }+ o) c6 F# u+ P' b, J
}
# O7 f) S3 _1 O$ G3 d* }2 Q}
* y) [; @% c( ~2 ~% D ]6 K
: h" U1 y5 T1 }结果是:. ~5 {7 [: B3 ]# |* B2 n' ^& @( L" I& D
result is 26 O1 J% b' x: M$ x: e8 \- l' ]
#% W* U' i4 R" D6 `0 v6 [; @2 H) M
# An unexpected error has been detected by Java Runtime Environment:
7 i! A) k2 G- _3 b#2 W! T D: z3 T ]- T! \
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
, p- @( r+ g: F. ^" ^; _#7 J3 @' I4 I" o* W# L
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
m1 s) |: b: s& J# Problematic frame:( S! y( e. Q+ r' Z6 @
# C [javaswarm.dll+0xb8305]& a5 i" `) _8 q$ |
#, L, j, P* W9 \
# An error report file with more information is saved as hs_err_pid1064.log |