我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。! m: Y! L6 v' H
import swarm.Globals;
! g3 m4 h/ G0 Z! O6 B W: [6 e1 B
# ~# z$ _% T. ?9 \! h2 v& b1 t9 U4 apublic class test {* i* }) G3 Z. C! P4 B3 U
/**
! a J+ U' L1 N+ J4 H! _+ Z7 w * @param args
/ W% X4 v) H' l' j */ S2 F; p2 `( C+ k4 D! ~
public static void main(String[] args) {, P( x" g* I3 q2 A# n2 ]( O
2 j. [% w- } v int y=(int)(10*Math.random());
' G, }) B0 I3 ]* W( `0 F" X6 N System.out.println("result is "+y);
4 R6 A8 d8 D% Z
1 T3 L5 h. F) Z$ B, w double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 ]! O2 H7 l8 Y
System.out.print(z+" re");
" Q, e' W& ^/ f' C. E/ H }
' o* c# m, ` p* _$ G4 p}
1 ]2 i: s/ h) R* ]% A% L, k+ R) I; M/ f+ Y
结果是: J# B8 H4 h* d9 K0 O7 V
result is 2
! ~* }" s; j8 A, Z' j#; }& `9 ^6 `. Z% ? E3 C
# An unexpected error has been detected by Java Runtime Environment:7 v0 `6 M8 S% L5 o" W- w
#( v7 ^" w: P! o! Y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: Q% }& a! U5 V5 a( U x$ B4 u#
" a* b: T0 b" M2 Y* D) \# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- _) a4 V, p1 e5 W3 b& Y# \: K; r# Problematic frame:
/ [7 O4 m. S5 @ B. ~& f# C [javaswarm.dll+0xb8305]# N' S* n+ y) W5 \+ R7 m
#
9 q4 I4 x/ P0 U1 Z2 e0 V# An error report file with more information is saved as hs_err_pid1064.log |