我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
' ^! h$ O7 b: Y/ A+ s& Iimport swarm.Globals;
4 Z+ C% C! [7 p$ ~7 ?7 n$ r3 [% V/ j* B6 v/ o- L
public class test {
1 n; y, ^! q/ f3 O, e) d: k /**
3 E) l! Z" R' M# U5 p$ S" E4 k; P2 Q( W% w * @param args
3 h$ f* V7 U& `* F9 T */2 a. |( V, S& Z* K3 j
public static void main(String[] args) {
( _- m0 i! K4 q ' x, T# b( Z4 D3 \- r, {1 e
int y=(int)(10*Math.random());% _$ V' Y3 d0 k; P5 D# i3 u4 o0 N
System.out.println("result is "+y);# f: N9 h( t* k
* d7 Q, O! g! K- T: E0 O! p double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);5 q3 X2 k2 n& F
System.out.print(z+" re");( y2 {' R8 f4 g+ K+ D; P# v
}0 u' R$ T9 s6 x/ c
}: H3 J) q' T4 N4 x- i: r' A0 ]
% [) {8 c) T. @! n4 j& \3 K
结果是:* C5 D4 M7 }( [0 \
result is 2
" g# Y% m# e6 R$ r#* ^$ @, u9 ~* S' }$ d
# An unexpected error has been detected by Java Runtime Environment:
* k/ w" q2 s7 }& i6 h: B#
5 m( I5 G& P( m" B( X' |5 I1 h# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
! M, {9 h2 @# V$ m1 O: Z#/ ?6 N- i5 y7 N( g( c& B/ s
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
. B" E/ r( T' M; N( ~* u# Problematic frame:
" B5 C4 d: E5 R, U7 v# V# C [javaswarm.dll+0xb8305]' ^; e3 m) T/ W t! R, C! [
#
/ h& T# X \0 ?! P v. O9 b& k: F# An error report file with more information is saved as hs_err_pid1064.log |