我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 u6 r; j, c* S v( \
import swarm.Globals;
8 [* q+ o: U4 \; L; [
9 [" D1 t% n0 |public class test {" I3 m0 f' E% J2 y9 {! i: f
/**5 r1 t* q1 \# P5 }2 y
* @param args* O8 a1 K- \( _9 ]
*/
' j) w7 [+ E$ t4 v public static void main(String[] args) {7 G! o0 m1 Q/ I! X
0 Y( x4 _) W, v, l int y=(int)(10*Math.random());) z& q) I3 \( o# ? x
System.out.println("result is "+y);% q/ l- P# e; z; M
; u, ~, J F6 P4 Y9 L# ?
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);% D. W* a: p- S" O2 e1 H7 U2 G
System.out.print(z+" re");" R1 h% A1 p! B5 S
}
/ R& T; i% _6 ^; f: C8 y( g' A}
t0 }7 o; _$ X& D2 [0 n
9 E0 ^7 g3 t, y; L# b结果是:1 }. s" n5 Q4 T
result is 2
: X. f5 j! D5 @7 n6 }7 ~# r# v' K( @; i& v* H, Y
# An unexpected error has been detected by Java Runtime Environment:( i# m7 m, Y. S/ S# e8 X2 S% S
#' @. E+ ?) T" n0 @0 h/ F
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10685 |% @8 x. H+ l( J2 x
#% M, p1 o" b5 A% o( B c
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ }& S3 ]% e: g6 M! K# m
# Problematic frame:% w( \ Y+ P" l3 {
# C [javaswarm.dll+0xb8305]2 b, j. }+ f0 u! y; L# W V
#; `3 b3 M2 Z# v) T, k# }
# An error report file with more information is saved as hs_err_pid1064.log |