我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。+ ?$ \5 f5 U1 f6 `' b
import swarm.Globals;
9 M f) k% c( K* F: c2 N/ U1 T; g* h) |' a, ^# i% y
public class test {* g; s9 J" l5 S1 Q7 x" e
/**
& r6 \: a1 ?5 p# d8 b * @param args
- R, z' w2 L8 j */" T( b3 s* l, f$ F% J: o
public static void main(String[] args) {
& N5 Y/ j3 X+ m! b& Y0 M ! t5 Y; A6 [2 Y5 T0 v
int y=(int)(10*Math.random());2 E2 t2 Z* G- h$ d+ [
System.out.println("result is "+y);
, u( W' B* _0 r3 b O' L0 U: i7 I9 S2 d; [& ^. E1 V
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
- D2 p2 U8 g }9 l4 q8 S; q8 E c: Y System.out.print(z+" re");
( y9 l7 Y2 `% p9 }4 z }
' O; i% H: h5 o2 d! p, o}9 q E- \) A( N4 v
! W4 b$ Y7 Z/ |+ Q. n
结果是:
8 [9 i5 l5 L( \1 z+ D9 V5 n% @result is 2
" r& G1 b$ [5 n9 v6 A% K" S#
$ c# G# D$ J% C# r3 O. _# An unexpected error has been detected by Java Runtime Environment:: [+ n3 g8 y, k+ J
#5 B2 Z( Y! N& T5 `2 J+ v! q
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
9 l1 o: j6 a% A#
, v [5 w4 I9 | t9 e7 @# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- A" q" }0 ~' c* s5 ^# Problematic frame:
. K, e# I* [, Z/ P1 z0 J4 a# C [javaswarm.dll+0xb8305]/ n$ O( x* S$ f
#% b$ q( _! t' O L+ Z. N7 ? f- d. e
# An error report file with more information is saved as hs_err_pid1064.log |