我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
+ d6 M: ~' L3 q! l: timport swarm.Globals;
7 D7 I6 r/ N b) r+ i
! U- s7 C! Z6 ?) rpublic class test {' E; b6 |+ q# m0 ^9 N, U
/**) r i& A; A- C
* @param args
! Z( t1 b; Q& b, @: ` *// p* N; F3 r! y( @
public static void main(String[] args) {
: Q9 _" E& r, { " R E! ^0 ~/ R/ c0 k
int y=(int)(10*Math.random());
" T+ r! g9 N: m- i6 Q! e2 r System.out.println("result is "+y);
: o6 w+ O1 U% r" H; u9 g
! T1 i M# e+ z) p double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 P" n% {$ U9 ~, S. |5 O System.out.print(z+" re");
0 s& Z# G7 F f: c% F }* k: \+ l$ r3 o# M3 ?. C7 F
}. \, A% ?! Z" A* ?4 c
4 c) O+ T! W( Q! t. ]结果是:$ k- I0 M; S6 J2 p) m5 A7 h. M3 |
result is 26 \1 l. C* M5 Z& o7 s% E3 v
#( ]+ M* j* o) V+ d/ g2 ~
# An unexpected error has been detected by Java Runtime Environment:( Q; V; ?, V7 ?" J
#
9 }$ c) i; t4 _: {* F3 K1 T# d# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 W) r' [' f- ^* [/ J0 P1 l9 W
#
& J+ f% Q' W& F) ^# j$ M* J6 ^# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)% Z0 ^$ f0 H1 a3 N! x) w
# Problematic frame:
$ `! e. m' [9 ^; o4 s- Z5 K# C [javaswarm.dll+0xb8305]- s8 s9 Q" M5 h
#
$ s5 S- {/ G1 S" A) A# An error report file with more information is saved as hs_err_pid1064.log |