我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。, h3 a( c: i: I5 n- y
import swarm.Globals; j2 O0 U- a4 [4 M) e- M5 W+ B& f
) j" G2 c; p/ ?1 r. ^+ @2 X' R
public class test {
8 U% r& H! i! y! b; F /**! M8 ?# g. }; g5 k+ C
* @param args
w% s7 \ M0 ~+ ~. ? */+ q/ w! H& M" y2 W- V
public static void main(String[] args) {
R. a' c1 g) p) L: z; r
P1 }/ l1 n- g0 `- [ int y=(int)(10*Math.random());
5 X5 `! I3 {. {! @$ R. I( w4 e3 @4 s System.out.println("result is "+y);% s# e, `. {- V. O& A
& \( [8 [. f/ Y1 m2 k, D! c, b
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
5 O1 R5 f- s2 n! k* B4 h4 w" | System.out.print(z+" re");3 w" S5 T3 i( J8 g ]- k
}
6 I) {. j5 ]6 T/ U0 Y* u( L# Y}3 D% W, ?8 ~ p& ~
% T8 E/ Z5 R: e. z0 L. ^结果是:
0 `& p( c4 Z0 a' j' v8 o6 }* J2 F, gresult is 2
$ x v1 f; g. c# n) G#
6 ^0 {1 y& _- U# N0 i% U4 f) Z# @# An unexpected error has been detected by Java Runtime Environment:
; X" H" j/ V& ^#
. k) } w7 O9 v& H: J& d# Y" f# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" G2 N4 U$ {, y) z$ U( h% _#" q, m6 L3 U) g4 ?, `5 @5 W
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ L. f: F6 D: _. b& w6 L4 W# Problematic frame:
* I2 k1 w( O5 l" S P' X+ H# C [javaswarm.dll+0xb8305]
! m% V$ r3 d- _' z$ \0 D# H* y ~/ l, E' }. u, y
# An error report file with more information is saved as hs_err_pid1064.log |