我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
, F0 {! _/ f: i2 Q( l* Aimport swarm.Globals;3 q/ _8 N. D- s; K, X
/ [8 L$ h! m) l& M. X
public class test {& a" y* E" p- o- Y
/**$ `3 y0 _! t [5 W0 c% W* ^3 ]
* @param args/ A8 @: u6 f2 O9 ^
*/
9 A( G3 H6 @9 t. d i* l' e8 Y public static void main(String[] args) {
# t8 a5 }% y, @4 X, n5 d2 f1 f/ l % t# L7 {' x2 T! T. F3 z
int y=(int)(10*Math.random());
4 A. T& Q' U- l1 J1 l$ ]% p System.out.println("result is "+y);
+ j! Y6 Z' a. f3 s' _
5 D5 K' U: `# `% {0 s" y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0); i2 `2 e4 H# o
System.out.print(z+" re"); }( D7 Y: _; C0 E
}
* ]4 H: O, d5 m) U3 F}/ S% a0 y8 q$ V9 s/ W
l, l: O/ p& T/ ]$ N- f结果是:8 B1 Z% c# l% r& h; A# V" E
result is 2
0 K3 u' X p2 E* k' i7 j% z7 y#9 o) m0 [. W3 ?
# An unexpected error has been detected by Java Runtime Environment:
) F! t8 V7 O8 ]3 w% R; D# E, X2 A( L* b9 \, D
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
- O4 e7 O& u% W* V#* E: x& ~( |8 }. P
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)8 k. i H4 m. v1 H( x$ c9 L1 m
# Problematic frame:
: R! C3 e" _- `: J; k5 p# C [javaswarm.dll+0xb8305], q. r2 W6 P$ m4 m1 D
#
) t4 q. \5 u) v$ ^# An error report file with more information is saved as hs_err_pid1064.log |