我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。4 V$ Y7 i3 E, ?' U. v- E
import swarm.Globals;7 X5 ]* L0 K1 J. T* D
; ~" F* K. X( A& {) z
public class test {3 i% T. Q& `7 ~/ Y
/**
* p* G {; p; O1 Y$ e$ g * @param args: ~# y, f' h1 d0 q5 t j, T- l3 \
*/
- S4 D5 _2 B) C: s public static void main(String[] args) {% J, b2 V6 {1 M8 j7 N6 f
9 z" O& Y" F: I4 ]+ D' e+ J
int y=(int)(10*Math.random());
( w7 F2 n9 p9 F System.out.println("result is "+y);
$ z& @& i; `4 C9 i
% L9 u- H# f* U. K7 H, ~, _: D double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 y! |& k1 f3 b! G/ z
System.out.print(z+" re");
; ~9 D4 E/ Q0 e- r; \ }+ ~% R. e4 b, K0 v, x6 M/ a
}
' l1 ~( K: l9 ^: a s! K0 R9 k7 V% h% F! c A
结果是:
- U! _* w p1 H- g/ F8 D" F1 Aresult is 2
; G9 s; \2 P3 a#+ T; R4 I6 g% A% M4 \9 |& ?
# An unexpected error has been detected by Java Runtime Environment:
3 {3 x; B( B; I# S, n+ ~ C% p#9 @! Z- H3 d' Z" G
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068& f" [ e5 `: c! k) Y5 _
#
4 U4 @7 A4 I7 A' L! G; M6 M! Y/ }# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& l$ R/ m; {1 A- ~. D: Q# Problematic frame:1 w: C8 k5 g5 K( C) f. M
# C [javaswarm.dll+0xb8305]0 ^& w z$ ^: H
#
+ `, i6 }/ O% a# H# h+ w, G# An error report file with more information is saved as hs_err_pid1064.log |