我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! \+ {' K3 M: Eimport swarm.Globals;
7 r+ _: y/ }0 {6 V; d0 a$ ]) m' i _# |7 D( l0 C' `
public class test {
0 X" t, u/ }6 T! K$ F7 _; u T /**
6 X0 f! u v7 h( U * @param args
! n: u# T4 L" g7 P. b! @8 j */& Q1 B/ c+ g$ N5 ]% h6 \; o
public static void main(String[] args) {5 J* f/ b. ^- S5 J) M5 E* P
9 G2 W6 j* D* c F5 J1 H/ |2 ^ int y=(int)(10*Math.random());7 i' L! ^/ U2 i) V: z' K0 X! e
System.out.println("result is "+y);
: V% `/ @" e+ f3 [4 @- a5 y" T; \% ]% C D% K, P4 h% u
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);6 N' @+ U i) X4 \! F# i, a8 b
System.out.print(z+" re");. {. g; D& X- w( m3 [0 m/ ] F4 j, ?
}+ d8 B6 m9 J h3 S
}: M# L3 S% Z; |1 ]0 z
( D1 ]& W u: S. V' O( g2 U" L
结果是:! y1 J7 P1 `3 M( ]/ F) Z# W
result is 2. L3 J3 M( t. }5 }
#0 C) {- U( ^. W2 z F" _
# An unexpected error has been detected by Java Runtime Environment:
7 f# B0 K4 y+ I: B0 q( [## B4 f" s4 W n; D; l- Z8 U
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
; _( `3 _& ~8 X! m5 V7 |#' i/ N. [9 B# j @! e& _# I
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
) V. h r2 \9 S( X& u# Problematic frame:
, {2 d' w) A/ F d$ v, i# C [javaswarm.dll+0xb8305]
0 ?( P- g0 L0 K- Q0 J$ Q# M9 @#
u0 G' W0 N* x! `5 B# An error report file with more information is saved as hs_err_pid1064.log |