我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
/ i; @' n1 u c. I5 Pimport swarm.Globals;
( }: w# i' U7 [% @, H( u5 t& x" x7 o
public class test {
# F. z& u- Y1 ^6 G" Z3 q- Q) j /**
+ i- y' [7 x; ?7 r' s) L( J' | * @param args
" c$ {1 X. |; l */1 n- C0 n8 l' V" k
public static void main(String[] args) {
5 ~. O( @/ `- |% s7 m# S) Y! q
- E( N& `/ \8 a+ M- O int y=(int)(10*Math.random());
3 J) g! j& _- K2 o- G( B( r0 A3 X System.out.println("result is "+y);7 G0 N7 D& W: S& p, w" ]7 w" U
* A9 [# U, \; i4 i/ U double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ R2 Y% u8 ^7 @6 V2 e# ] System.out.print(z+" re");
1 n6 v2 ~* U* L, t/ D+ a }
6 H. z7 C9 G8 H}1 N" U4 f% ?1 A6 n" }
; M- F9 D; C' h2 a' T
结果是:% k$ d J) B7 j9 F9 f3 U ?5 u
result is 23 H, ^4 F9 \8 Q0 R7 E9 c$ z# f
#
- }4 w- f3 Z5 U# An unexpected error has been detected by Java Runtime Environment:- y2 s6 p) ]/ R# L
#& i( G: g) o8 Q
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
5 Z3 a) G) n0 U3 |3 z#6 U$ j1 m! y& t% d1 m6 \4 T
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)! Q) X, D, A) ^- d0 C
# Problematic frame:
: Y4 S: U' v& j( B5 t8 Q# C [javaswarm.dll+0xb8305]/ P1 X! n: O+ h- J
#
9 b, X$ ]; Q% n3 i) \/ p# An error report file with more information is saved as hs_err_pid1064.log |