我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( {1 H" ~! }: ?# X$ R7 Eimport swarm.Globals;
& l( _+ H" J* U0 b4 x% O7 S5 [
public class test {( `; q r5 @9 S* Q
/**$ ?4 {) t( Y& H0 b, `
* @param args2 s- X7 |7 F6 ?2 b& C2 o
*/* Z6 M: X4 K+ _0 Q2 L8 k- B+ O
public static void main(String[] args) {
. @( B9 N6 M) V1 N% B# [ : s1 O( R1 R0 c! v; i3 Q
int y=(int)(10*Math.random());6 \6 t- Y1 _$ G! @; D( G3 A
System.out.println("result is "+y);
" y0 ^2 S% d# d& d0 [/ n2 P# i0 g
8 N) h6 n2 [3 S- I, t double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
7 j! E2 Q- a, ~# n* I- k; W. ~ System.out.print(z+" re");
' l! ]1 ?' m7 [5 _/ K1 ` }
% _& l1 l& J1 U% g2 \$ o$ d}# z2 f/ P0 w! ?9 g1 [% |
# ^8 I% [7 M# x+ v: L" u- W结果是:0 N$ C3 _9 n9 A* ?0 a5 I) p2 Q; S
result is 2; R/ @3 t& X! s9 z( P5 s2 ?
#
3 c, E; Z8 D/ |8 N+ E# An unexpected error has been detected by Java Runtime Environment:" i; }3 q$ R: s& o+ j
#3 G9 O5 W9 T- M" ]
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10682 o- I" \' {& y( ]
#+ \- J& K8 ]# B8 Q
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
1 t2 M. Y4 S; V7 W. m# Problematic frame:4 @. t2 k: |. ]# V0 N. N" N1 K
# C [javaswarm.dll+0xb8305]1 g# K# L5 J9 k' R
#" `3 k' x x, n) e) M9 k
# An error report file with more information is saved as hs_err_pid1064.log |