我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
m1 B1 w% H( ]1 b8 Cimport swarm.Globals;
6 a3 p6 u9 d( f' d1 ^7 Z7 @% ]6 B& a7 { Z0 y- A8 b
public class test { r+ F- W- R7 Y) Z, @2 [
/**# ^0 A$ q; w6 J! g) W
* @param args
, _ j! ^! F5 u1 M */6 H; K2 N9 x6 i! \+ v; ~2 N8 {
public static void main(String[] args) {& _6 T: S9 J/ J1 f
$ G- y$ o/ E E8 F2 o
int y=(int)(10*Math.random());
5 ~7 _' V0 _- q5 ]+ H/ a System.out.println("result is "+y);! q& w* [ y U- V @2 Z& k
2 P" v# p( y. w9 \0 o0 \
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
0 l/ P8 C8 b( A+ b1 Q! @% N System.out.print(z+" re");2 z8 i) j( Z' |( [2 v
}
, e& G% b( j" X+ L0 _: b}
* ^% R1 |1 P7 U( g( g) ?- d" s% U5 v# h/ B# U9 i' G+ K+ f T; U; I
结果是:
- y) D2 c6 {6 f2 fresult is 2
- f$ P8 `- K' | Q. n% m#
, E7 q* {3 n) @# H# An unexpected error has been detected by Java Runtime Environment:
' b3 b" P ~7 y0 D/ P! X% J#: A+ O9 p$ D/ M! Y( C! w( f
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
v1 ]5 `2 o; C6 t' Y5 S/ X#
. V5 Y; s- k9 T! _# Z1 x# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- I* h. D4 t. J- I9 y$ H9 ^# Problematic frame:3 a V1 F, e( I: d* S
# C [javaswarm.dll+0xb8305]
* o0 t+ k) s# W4 J, i! Z( E- L#
8 s# E# ~/ Z% j, J V# N6 f# An error report file with more information is saved as hs_err_pid1064.log |