我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。& u, ^; l) B/ n/ _5 }
import swarm.Globals;8 |( O8 B6 m. Q _
8 s8 o4 r- `* f7 m# g% `
public class test {. G0 e/ u3 P& c# y
/**( T4 `" Q4 H8 P
* @param args; f7 ^) V0 v0 O, h
*/0 v( L. r+ d5 ~
public static void main(String[] args) {
4 {# ~8 a6 T! F* o0 R
1 N! x" _" W# V* E int y=(int)(10*Math.random());- H6 F- l0 X6 A% n
System.out.println("result is "+y); G$ X7 g# t% V! P- H; w8 t
; U2 Q* p' h" @' E# Y8 x' a, e" G double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, g% Y& P# V: y! o( a" s
System.out.print(z+" re");
% T# {7 [ E" m& c- [" s }
7 N. K! w: H& T0 P$ A% G, n}& F( y. @/ j8 x: V/ ?
% a$ y! k+ J5 m结果是:
" W& e7 [' `/ ?result is 25 U# V3 l/ x6 d1 f7 N: w- G. Y' B3 n0 I
#/ X2 X" S( Z/ h+ v
# An unexpected error has been detected by Java Runtime Environment:- o4 o( n, W" W6 `
#- X3 o& }5 z+ ?' ]" v
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 J; x) \# d/ O( I3 ]! P2 z
#
5 ^/ K0 g- ]) o" X* m* V% S# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
; s. O( x' y- Z* a# Problematic frame:4 g- H- T& Q6 S2 h4 V2 H. n
# C [javaswarm.dll+0xb8305]
N/ k* L; \ v#
) _, N* u4 ~: Y, A) z# An error report file with more information is saved as hs_err_pid1064.log |