我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。% M/ L, t; x" k0 V8 Z
import swarm.Globals;% |) ]- T( s5 K; f$ }
' B3 `2 ?" [& [7 [! O% L% y
public class test {& v( X# ~6 j9 V+ ?, y
/**. f+ `0 p3 r& ^4 c& z
* @param args# a. @% Q# @0 P) L1 ? l
*/$ {7 `/ v3 D( x- V/ E
public static void main(String[] args) {
7 ?/ T% b' f x. `
% Y3 J) ^: _( V8 Z, y int y=(int)(10*Math.random());
! [, Y4 E2 J' P n" ]- L System.out.println("result is "+y);
! i6 g2 M4 _, ?5 T* \; \ n! q' q0 H# z1 I0 Y) L7 n
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 s( b0 I/ x# { System.out.print(z+" re");# D- l' {8 k2 _3 I% t
}# P9 v& O7 R% D
}
3 R) v, h9 \" Z: ^
" f' z& l2 N; B$ p结果是:
! M) ~% O K$ _result is 2
& ]+ L5 B' D9 V' ]% X#
$ O, f. ^, a. O1 R; ~# An unexpected error has been detected by Java Runtime Environment:: A5 |7 g4 ]# T& N# N o0 h& t* A
#" Q1 r9 G J& X( E* M
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
/ `! x; Z% y! U#2 C" H h& {& ~. D" Z3 S' O
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 D/ n4 E8 G+ p) ^& o
# Problematic frame:
5 e* O8 D i. ^/ Z# C [javaswarm.dll+0xb8305]6 ` m4 a; i0 k0 C7 e Z
#2 x- y% W$ ]) d" g6 V
# An error report file with more information is saved as hs_err_pid1064.log |