我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。. t2 A8 z$ ]1 q4 r
import swarm.Globals;) j: G9 f. P$ Y! }% }
; `' L' E% j$ H) h5 h( K$ l
public class test {
\. H) @3 V; N8 a2 _' `9 M- w /**9 @- J( g4 `$ k3 ? N! J
* @param args, g: J, x% e6 E3 E3 Y) p
*/
6 y& o; \7 D$ t* P- t, E public static void main(String[] args) {; ~, u' T3 R# \
- o/ t5 {1 s/ V; P int y=(int)(10*Math.random());
" I$ h0 i4 p. `) ^$ B6 K System.out.println("result is "+y);( q6 `9 Y* w7 s4 D1 j
+ b3 }8 \" k; V5 F1 _$ E6 O
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
& A& p: a* @: ^. ?1 P: d System.out.print(z+" re");
# d5 a0 G8 M+ W3 Z' v$ U1 Y( y% N }$ |3 T1 ^9 w7 \/ w" v
}. V3 R* w& z2 G( c. K c
' Q, y8 M: p2 d7 ?/ f; N1 l+ O# E
结果是:; _1 l* i( w- C( x J
result is 2
0 x- {5 _3 L5 q: M8 D#
0 N2 ?: @( Z' f1 M: o" o# An unexpected error has been detected by Java Runtime Environment:; G, J! _/ A0 d5 G( E+ v+ x& P
#
- P& z3 c: M: Y5 ~' Y% f# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068) [$ R: y. ^4 c/ n% F, b, F. [8 D
#
6 F) C' ~& M* ~# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
' y4 k, Q( |) k' F& a# Problematic frame:6 Z: a- q; P2 e8 P6 q; a! m
# C [javaswarm.dll+0xb8305]
! |) g: I- I& w Q#" ?8 O* Z, X4 l1 f) y0 c, Y
# An error report file with more information is saved as hs_err_pid1064.log |