我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% Z: l' Q; X4 c+ bimport swarm.Globals;
7 U s* A& d7 ~4 s' D0 }' e# i1 s; k$ J
public class test {6 h; j! L6 ^ Q! R5 m2 p0 ~" r
/**
( G- Q- s, u7 n# r- A * @param args8 k- o6 W; A+ b4 E; t" `, `
*/3 w# k$ p# f. }) w4 x" V" B
public static void main(String[] args) {$ _% P- I3 Q' x3 Q3 O6 @: K3 G
: ?% [ e4 H- w+ ]9 j1 {
int y=(int)(10*Math.random());$ c8 Q3 Z3 P' g9 I
System.out.println("result is "+y);
4 A" ~8 _' K3 P. G0 y/ b( j5 p- f* S' q2 x" q
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 ]+ H* N5 C N
System.out.print(z+" re");
8 j3 c/ Q: W' ~0 g/ x I" N }# c) ^1 T6 N \7 t: D
}- u8 i% V1 y/ t) R
O4 I! q8 K, ^
结果是:; m, p/ h) X$ x4 Q
result is 2 H3 R/ _; U- [3 w
#4 u$ m, a% j$ j, s, v, ^& K3 x
# An unexpected error has been detected by Java Runtime Environment:
1 c" n& J6 l6 D5 `0 |/ j) w#' I) C+ ~0 u3 p0 M: x9 X/ \ \1 x( G
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 v- h: s8 {: W5 w- x& M#
9 M2 H" O# {2 b! f, N/ u# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
0 k- \6 O6 Y( E$ Q# Problematic frame:
8 X* \" W3 Y$ v/ R/ j, f# C [javaswarm.dll+0xb8305]9 s3 Y: L( h5 ~, ?
#: p- {; F6 i1 J# P
# An error report file with more information is saved as hs_err_pid1064.log |