我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
0 r& I9 C% d. ?+ j- }; qimport swarm.Globals;- X& |/ m \. D/ z K5 B& E
) |6 v5 d* _" }" K. w9 Q$ W) M
public class test {3 @ ^" l* J; v8 |. x6 Z+ P( G1 q' z
/**
# P0 b c# \ L" X( ?, X- T * @param args
: t+ F; d% g1 A9 r5 K- X, Q& J9 u0 _8 R */
( O) x! t6 q/ X4 \& P9 W* J: H public static void main(String[] args) {5 h8 i: \: D D+ S; l
: ~9 O+ {/ s3 L. Q int y=(int)(10*Math.random());+ `6 \2 E2 `: c& H. m l X V
System.out.println("result is "+y);
/ ?9 `9 _+ R* L5 y1 M# d+ S1 {0 d1 W; _: J
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);8 ~4 @. M6 K( Y; E
System.out.print(z+" re");
6 N) O" y+ u# V( Q0 X }- j* M6 [+ A( A0 M* l* T* |
}; ~& K3 U& K+ _) K& U
7 E. q* d! p$ }- p结果是:2 F4 `/ i8 V! V7 U3 I$ [5 P
result is 2
9 p5 q- q8 \4 c( Y! b: J#% g- G; w$ |: G2 Q
# An unexpected error has been detected by Java Runtime Environment:
5 ]) b9 C D' N) \2 h$ b; M#- ~: I, Y* w; N- B
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068. V# y: x0 R0 J$ |/ H
#
: n' K. A$ X, K3 l* o0 Q# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" m! i+ s; U2 u Z* D# Problematic frame:
: r8 q5 J( c" V# C [javaswarm.dll+0xb8305]5 o- e7 y1 r4 e7 _$ U1 G
#
9 E+ [6 u1 |; {; L) b7 e0 Y6 {8 y3 F# An error report file with more information is saved as hs_err_pid1064.log |