我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
2 h a/ a7 k7 n. @import swarm.Globals;' w9 ?3 R1 m Q, B' |; Y% K
" J0 ^4 v' O) G# X+ ?public class test {
" u8 ^- {- a% o P8 S$ m# k) n /** E, ^+ X) |6 Z4 s; E
* @param args/ S5 F a5 G9 f' m$ K: o6 K
*/
. `2 r; m) d+ ~ g public static void main(String[] args) {4 p! G: G, u( s, q
" o! k% B4 i3 U1 W8 M8 n
int y=(int)(10*Math.random());6 F$ {6 b& {& C
System.out.println("result is "+y);9 ?- u- y4 ~2 a* |4 D
9 w8 ^2 O; L" i
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
8 X* ^" C7 ]7 s" s- n; e System.out.print(z+" re");
; M5 h3 ^$ K x& o* h }5 t7 W- H6 ^6 Z; @ D
}& q' c( d/ k, w, b& a, b# ^2 c
4 V+ M% y8 `& g) @; Q3 J结果是:" Y7 u. l+ \ X# t$ a- u' z
result is 2
4 S2 E0 A# i4 `, s, ?+ d#
2 V: a9 B* C7 |# An unexpected error has been detected by Java Runtime Environment:
2 ?. b( r: W5 K- C#& w" O- x v8 s
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
* C7 s& r6 V4 y6 ?. d3 x, A% r#1 q3 L" `6 L- F6 x
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
7 N) I& Y2 \3 |( g# Problematic frame:
' \7 E- W6 Y/ _# C [javaswarm.dll+0xb8305]5 P( U! d7 e! E" o: l' Q
#6 A! b* u, Q+ o8 z. f
# An error report file with more information is saved as hs_err_pid1064.log |