我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- Z" Y- @( s- V) m l* G/ fimport swarm.Globals;
; i; J/ F* v' f
" T6 Z/ l/ b' m/ U" j- hpublic class test {
& z' g# Z" q0 E E0 S /**
) o' a! U& c$ d' } * @param args# I, E1 \. p$ b! w2 N7 t/ P: b
*/) S2 `- r8 e% h! I. Z$ ?; {
public static void main(String[] args) {/ P' y% N6 ?9 b; n" S( ^7 P; @# J
7 }; n0 I/ ^. }% x
int y=(int)(10*Math.random());
# n0 ^5 p+ ^# S$ S4 r System.out.println("result is "+y);
5 D* O8 Y- T" Y; d4 Q+ W+ t3 t; B! L' r' _
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
" ]3 ]% Z3 n/ U System.out.print(z+" re");0 h/ c; A3 m* t" \& y
}% g# U( P9 D' I+ O- |7 |
}' P8 i4 A4 z1 {% `+ |. H! d
- q2 v H8 e+ f+ s! j结果是:
3 J8 _" \. s3 n/ |result is 2 e) S# ?! P9 B& m" G; J: [9 |
#, ^4 f7 \4 k. `& d8 c- T% U
# An unexpected error has been detected by Java Runtime Environment:
4 A1 S9 |8 I: _' H3 f6 M4 g' N q5 x#
, L1 N! j5 O' X- U6 q6 Q# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068( U% R! u# I: g! y* @1 L8 o
#
; k d3 l( O+ u. A& F, x$ d# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)% q* W0 M1 |6 Q" A v, w, {! i; g
# Problematic frame:
; z: b* B; Z6 q9 Y# C [javaswarm.dll+0xb8305]; K1 W1 n) o. \$ k9 I4 c
#
0 e: P8 X6 |; z( V& ~( q" H. Q6 j! b# An error report file with more information is saved as hs_err_pid1064.log |