我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ |7 J" x+ Y9 \import swarm.Globals;
0 Q: F; p: O( H. G& [$ @3 M8 f3 M; u _2 p7 D9 m
public class test {
4 m ~+ a( o Y6 Z /**2 _( P9 h# ~' h* j, ^- ]* x4 s- M
* @param args
0 w4 f; G2 P7 U2 D */
, [4 p# S2 v# v6 d& r public static void main(String[] args) {
+ T+ U% q4 A5 L * G; V% A6 W5 ` r2 r2 @5 ?
int y=(int)(10*Math.random());
9 q9 b) u. d' ?- h6 c& A A System.out.println("result is "+y);$ o' p3 I1 l4 U4 g! v" w
$ |6 F- A+ a$ A( }5 c& J
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
. F8 T% ]( j6 ^; H: }! U System.out.print(z+" re");0 x, s* j# Q, H
}6 }6 J" ~8 h6 |: N; ?9 y
}
% p/ u, k2 B3 u
* E7 _* p* ?: g1 @1 ?结果是:: o: r$ G5 C* [. ]0 u! k# \# s
result is 2# Z% V$ g3 n1 I! }0 k
#
' k/ V* r. U% Y# An unexpected error has been detected by Java Runtime Environment:7 B- @- R$ ?1 \& C! k, D% [
#
: B/ P$ @& w, J7 U# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068/ Z3 C* j8 `, m6 G- @ | U
#1 \# {+ O" e. S; X1 _
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 |% Y% F8 I- y$ p0 `, v
# Problematic frame:
; {7 d7 d5 v" c0 M( Y. |. H# C [javaswarm.dll+0xb8305]
- u8 [9 g' ^1 A I#
% V8 `2 Y- T. [5 m# An error report file with more information is saved as hs_err_pid1064.log |