我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- i* s$ j2 Y9 H! F; Simport swarm.Globals;
1 s% e8 i* B: B
' g/ L+ f1 q i7 \5 |8 upublic class test {
N9 S4 n3 x' |& X4 P+ I; F /**
8 D2 R( @ T5 H * @param args, K: P. @8 g: K3 @9 B& O$ R
*/5 {# D! y/ S( W1 _* `2 h
public static void main(String[] args) { r& C! i1 d2 L& U, X
* Y j% y) _/ T8 p, Q& d% r
int y=(int)(10*Math.random());: d* R+ Y- @, E y% h3 T( q4 X
System.out.println("result is "+y);
, g7 J- x* i# f; C; ?
' w6 Y F- u* r! N/ ~9 y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, x* N) F+ n' M$ [9 G
System.out.print(z+" re");0 D+ \( N! e; \
}
1 h7 Q2 o5 K4 b* ^) G8 Z}! G( W0 v. B- m# }6 A% U
7 L( _- S: Z3 D: ?结果是:& i9 d, D9 v( {* [2 d' O$ v
result is 2! ?( ^" y& a2 \2 z
#
5 r; G1 Y4 \) w, {$ k+ o# An unexpected error has been detected by Java Runtime Environment:, ^1 R6 {% T9 p3 K/ m& z% ~
#+ w5 @2 Z. P. t% ]
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10682 a. ?" e/ U- Q
#
" I7 _. d$ h4 J$ ~# [. q# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ r) A4 G/ W) e" P# Problematic frame:1 q' P! |6 c/ |" x
# C [javaswarm.dll+0xb8305]
- o% |' ~6 f5 _" F0 b3 t/ t#8 I( @0 P; Y* ~
# An error report file with more information is saved as hs_err_pid1064.log |