我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 c; G, P( z; Kimport swarm.Globals;$ E0 B( V4 r" R
9 L/ O% K+ h6 n: B1 hpublic class test {
1 D3 ^& q2 ~3 Z /**
0 Q ^1 G" X! Z5 f9 h* w5 b * @param args2 {% e" L/ o2 _
*/
9 t) ~( D$ i4 C( y9 \; { public static void main(String[] args) {1 L# C1 t' \, r$ A$ `
- s: ?' c. n% Z# n* C6 M int y=(int)(10*Math.random());1 m1 K+ f0 w* ~' A6 w% V
System.out.println("result is "+y);
5 y1 \1 k, @6 ?+ `" }' u2 ^
) q; [4 t! I+ m6 @, v2 q# j( H* y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
+ |% k4 K: I a0 C: k7 {. @ System.out.print(z+" re");$ T6 c* X/ W' C1 b& C; U! Z
}5 b$ z9 } k& w0 h4 U9 ]
}) o* r0 s% p v6 H5 {0 _+ {
6 _+ J1 K- Q2 a, p6 E结果是:
" H8 Q u% }, K, E( ~result is 2
) @9 F% k T; }#9 K2 a1 P+ O T) q3 p
# An unexpected error has been detected by Java Runtime Environment:; S/ f# s0 s2 [) l4 A& `: L) b
#
1 A2 u1 h P6 _0 }6 f+ g9 L" Y# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
7 H- \; Y, D/ b5 U( P0 }/ y& b#
# R: Q! N" f% A1 N% a, R# s2 p# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)6 @* O; B, m' `2 _
# Problematic frame:
0 g# o2 K$ l* b. @! {# C [javaswarm.dll+0xb8305]3 O* T# r3 S7 v. [2 i+ r
#
" v* K. _% D' L$ t2 J1 {, ?- d# An error report file with more information is saved as hs_err_pid1064.log |