我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
6 S3 _( v- D5 _) L# J' q7 Jimport swarm.Globals;
, Z% K9 g% s& G) r+ S% Y6 D$ R1 D! K
public class test {+ y& ^0 A. t! D7 R( t
/**
% {1 I1 X9 ]9 k- Q; t9 k * @param args* f& D" t. x( P% T3 G F$ e3 d
*/
6 E. N/ R- ?5 [) r8 A v' p/ B1 q- J0 h public static void main(String[] args) {$ J' H1 G: t) Q' E1 m
! w2 [1 f5 @( _4 x: e6 P
int y=(int)(10*Math.random());
, \5 K9 h. T, D: k( ~3 ]2 W System.out.println("result is "+y);
8 t$ Z7 n+ J. K" k% u0 |; Q. R5 W" _% G/ W. Z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, ^. E2 v! r/ U4 E+ L
System.out.print(z+" re");
' w" v- K" N* f# B( \ }
( Z2 E& q% M1 l. T6 `}2 K1 r* O6 Q' l; r+ W x
4 [+ D5 {+ p9 c6 x+ m. A结果是:
5 u) v; B6 |7 b/ k) X- R6 ]' _; gresult is 2
5 f, y" q' u5 K5 R6 A#7 t3 w1 I$ p6 a3 ?* G
# An unexpected error has been detected by Java Runtime Environment:
+ u. H2 u/ k/ }. b% }/ s* V0 y#
) V* D# w1 f7 B# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068, A9 Q+ q* N2 [$ N3 t) [# p
#6 V2 N$ ~1 c# h& V! x1 {
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
0 \/ }, _+ U/ |- k# Problematic frame:
9 x& s0 ?+ l8 J# m0 P# C [javaswarm.dll+0xb8305]- E; {6 Q+ I+ }0 X) z
#& a' R0 A6 }% ^- B G" n
# An error report file with more information is saved as hs_err_pid1064.log |