我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。: y: _4 H# O4 E' t" x
import swarm.Globals;
7 z$ A# Y0 T/ `: E$ J+ O8 P' k$ z7 ?3 A5 T
public class test {( f4 l* }. `+ e9 w) }- P @
/**
) F( h1 G. E" i * @param args7 k1 q6 F8 K" q4 e/ E9 S
*/
3 R8 M2 J% S, L public static void main(String[] args) {
+ I) j5 Z' U; T) n+ m+ Y
- I+ @" J4 h$ s5 s3 r; A6 N int y=(int)(10*Math.random());
8 |. \; P3 e/ s+ B4 ~& k System.out.println("result is "+y);
4 Q5 p! E2 j0 e+ X/ q6 c: Y" S# B+ B$ V% `8 L
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
, t9 D% K3 N2 W' f3 ]/ C" k+ \ System.out.print(z+" re"); I P, k6 v }
}4 b' D: N) Z9 _0 d7 G8 w# G
}( t( R% ~2 p( o; e# {" r) `+ B7 [
+ _9 Z" Q+ x1 U$ t' I. n4 ~& j+ v. p结果是:
! S* U: E N7 }2 Hresult is 24 X/ g/ m- o% f5 C3 U
#
3 |8 a6 c ?1 f1 X# An unexpected error has been detected by Java Runtime Environment: H0 {; S0 Y6 N4 b/ K2 `% X! w2 M
#
' t" V0 T8 t% i- N. B+ q# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
% w/ U/ h9 M" L' t4 r# A#
/ T# g3 o( }; M# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)9 G8 z. T* N# t! f
# Problematic frame:' d- s) B: [: i$ e( H2 S" f
# C [javaswarm.dll+0xb8305]
/ y) i: e. q+ i D0 T' x6 _#$ T- Y8 f% o$ c* k$ C( O+ J( H; c
# An error report file with more information is saved as hs_err_pid1064.log |