我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。8 a/ \4 ?' {/ O. S8 d9 c
import swarm.Globals;
& R, J5 ^' S' j8 Q- t& s5 u) W. [+ t8 Z# _/ v* f
public class test {
' F; J' i9 ~) g" ] /**
& a$ S0 u* t0 l, U# r * @param args
; ]9 i+ ]1 ?' ]- s. l( w* q */' Y: Y: t! `0 z
public static void main(String[] args) {
: i0 S" @4 U3 J ! P) J4 q4 I1 o$ f' E* [+ q, M9 x
int y=(int)(10*Math.random());
: a+ e5 z) W- ?0 Y3 r System.out.println("result is "+y);
0 W' c& k/ s2 E& f* s8 ~- P7 |
& `2 c* C e* _4 j& t' A* J8 u1 y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
, D# B t+ o) K2 M3 {# w& k0 j; j System.out.print(z+" re");
! w0 }: O: P; o \; C }6 v1 B* m+ d1 n1 g- N
}0 [6 H- q" b4 }& P4 b
% D5 B$ R' u6 C {* ^& Y结果是:( Z3 h1 o$ i9 ~% |7 w3 r2 q X P
result is 2
* @0 S8 ^0 l% g" S. l#, I0 N+ ]- Q8 t6 |+ t
# An unexpected error has been detected by Java Runtime Environment:& I' p' H$ E0 f( |
#
4 W6 W' K, {. P) y# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068( W2 M" M7 @8 z/ r" w" { w3 a) j5 E' Y- g
#
$ q7 s/ W" _/ m# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
: g7 B# K; g2 I3 H2 {# Problematic frame:0 p9 |- Y) A+ ?/ v; a. q A( G
# C [javaswarm.dll+0xb8305]
' ^6 A7 R/ g) i6 o; _0 {* R6 R3 b% g#
: i7 K* r, z# {3 L8 n, v# An error report file with more information is saved as hs_err_pid1064.log |