我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。9 w$ S G' D$ p6 t3 ~
import swarm.Globals;+ X" U8 M: n# N m" j f
% z$ W4 Q# b/ M$ P, p" ~public class test {
$ H: I. y9 M2 y* o0 N, H+ k! w: R. y /**
% k2 v* `5 _! X * @param args! f! M& M& p& Z& V {
*/- t/ b8 z; a5 n$ N7 x% |
public static void main(String[] args) {1 z* M9 e B9 R6 d
* A8 _% e+ {3 W: C8 T+ }7 [ int y=(int)(10*Math.random());
$ y q1 E$ @" ^5 z; \# K/ O System.out.println("result is "+y);/ m9 C3 p5 E$ b2 w5 M
: {' H2 i {8 u* d double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);2 Y2 l6 k M( T
System.out.print(z+" re");
; x: `' A7 c# M } c4 _% G0 u. t+ ]
}
& v+ H0 d9 G9 @" ]. J+ x8 \$ f+ a5 i4 e k
结果是:& Y* T! n7 j) e5 p. s; [
result is 2
. m! ` X! A" J: U$ Q+ Y#
% M, R) `' D" g# An unexpected error has been detected by Java Runtime Environment:
. Q+ U x# n. H. A#
) Y- o% i( H ~* J# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068& W$ u2 G) V! N0 J) W
#
7 v" a' ]5 r+ J( g# I+ m7 V+ d8 r# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)2 {1 n9 {. l& z+ f
# Problematic frame:" L. G& x3 X. k" l, M
# C [javaswarm.dll+0xb8305]
1 b6 X# o. m% Z0 h8 j#+ p U- D0 y& h( S2 E
# An error report file with more information is saved as hs_err_pid1064.log |