我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
7 C% N x# A: b1 t* G1 Z: |1 Iimport swarm.Globals;4 [& V7 [; c6 J4 }- j1 \2 M
- i7 ~; ~4 ^2 f! `8 B" V+ |3 Q
public class test {
" ?. o6 u- @. b /**
v2 K; c4 ?: t5 \* s * @param args& E+ g9 r9 e* x; W
*/
! V5 x- }" q( A8 Y4 |8 t public static void main(String[] args) {' Q/ ]" ~( o5 w3 R/ v+ M: L/ f
4 A' Q8 A3 ^( u, ]
int y=(int)(10*Math.random());
6 D* q8 z" p7 K$ H System.out.println("result is "+y);
" G* s9 ?$ `9 d& O2 P/ ?. k6 P) i( e6 U0 ?7 A! N0 d! N/ z# x
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
! c# k6 S; @2 B, J# c$ @ System.out.print(z+" re");& C0 L: } y+ c) d; Y6 {
}
, g3 H7 m/ o7 h( U5 n5 M}
. l$ N# g9 Z6 |0 O, G1 p, j# C- M7 ]+ @4 i/ A& O7 Q9 o
结果是:
3 J& `& j4 W* u3 ^result is 2+ ?! c# C" v1 I& X T2 i
#
% e: a$ e% u2 R" L; d# An unexpected error has been detected by Java Runtime Environment:
9 t: E1 z8 b4 H1 K/ b/ W4 d3 \#+ w' Q5 R6 J; c2 x1 I5 z! f
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" ^# P9 Y4 b* L$ m1 g% {% L#( a/ o& D) o4 q9 M9 P
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& i, ?8 G& I0 n$ l4 t% I
# Problematic frame:$ H9 A& Q- F0 [5 X: C
# C [javaswarm.dll+0xb8305]
0 [- P5 U- _/ S5 I#
6 N% P/ G7 y8 t# An error report file with more information is saved as hs_err_pid1064.log |