我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
4 O D5 u2 A. l6 ?+ x+ I% {/ timport swarm.Globals;
% i, U4 X2 L2 r* E9 i; n7 c6 p4 d, j% U% Y7 a
public class test {
, K6 @' A6 z9 F+ {8 I /**
! G8 x" l, A+ B5 s- f * @param args0 \; z) p2 ?9 p
*/
, N0 o) p& ~) W8 J. b* `2 U1 h6 @& B public static void main(String[] args) {# U# Q! T" H m/ p1 G; {5 [0 ]
7 ~* R& T6 R- T6 n& Y4 S' r int y=(int)(10*Math.random());
* f/ o9 U- R5 K9 U) U( _ System.out.println("result is "+y);+ s( ^; b- _( n- P5 h1 H; U' K* S
6 |1 t8 G N% ]2 e/ y+ J- @
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
B) `/ V* g, G System.out.print(z+" re");- k7 S& e* H- z5 S, o
}
& Q! R; W9 ?) X6 N4 X( F# ^}' O. }# S2 r2 v0 e# M1 r8 t
5 l, f; W+ F( K6 z8 e& U# B
结果是:# a i: ?& \+ d* Q& q0 k% P
result is 2+ ] w( |$ q; i$ `& p
#3 n' E4 _+ o1 B( Q
# An unexpected error has been detected by Java Runtime Environment:
$ }$ x; F0 @/ a1 ~" S& U9 r#
' C5 h- ]/ I4 }" N. a- i# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
) z9 P3 e8 H6 k8 F9 l( z# g#
) B* N8 U2 y8 f$ q# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ E" G( Q/ ~) r6 @8 {# D0 k2 I# Problematic frame:
2 R! `" v) i' n9 g7 [8 ]* k# C [javaswarm.dll+0xb8305], V% y6 l2 u" J
#8 D" l) X% U5 w( {
# An error report file with more information is saved as hs_err_pid1064.log |