我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 b8 ]$ j/ y7 E6 t% y Q$ Eimport swarm.Globals;
+ t: ~. a" x; U! x2 I$ P9 X0 b- W9 r9 X0 @
public class test {
$ f# y6 c [2 o% l/ O% E /**, k/ V6 Z9 \, l6 l- I* p
* @param args/ R4 X, O9 g/ s5 Y% A
*/$ s4 [7 p2 _" @+ M
public static void main(String[] args) {3 n! `; n. b* S* Q. b6 [" i% u8 N& J
! t1 r- }1 T5 t6 _ int y=(int)(10*Math.random());* M2 t' @5 t$ O( ]. I* v
System.out.println("result is "+y);
S9 d$ t- b* ]2 ?3 k. J# H1 ~ U' i& x( B
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
# o! g8 H7 l; ?1 }; N; b3 J: T System.out.print(z+" re");
! X- O6 [0 h* w2 X }' K5 y8 [* c( l! Y9 p: W5 s
}9 a- d. m% g2 N; z6 g0 J
+ S& |; ~8 k) T( [: ^6 v$ s
结果是:
" |" c$ i0 f1 wresult is 2
- J+ p& l2 p* {. n5 S: h# u#
2 {, A f/ I. F! K" l7 J t4 V# An unexpected error has been detected by Java Runtime Environment:
) B+ I5 {5 i) U; m- g4 n4 `#* E( h2 l: E; P/ z6 ]: _5 Q
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
5 Z' F# u8 u: e. Z& e) y#$ k1 M9 ^: M# c. B
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)) n2 i0 l0 A. s! p$ I {' M
# Problematic frame:4 J. Y# {, B- M8 Q( p
# C [javaswarm.dll+0xb8305]+ n3 p0 M4 q r) W* V& p
#
3 b ]- a) r3 R4 G9 |# An error report file with more information is saved as hs_err_pid1064.log |