我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
0 k/ m6 k$ Q+ [. U# `" Z7 I+ ^import swarm.Globals;6 ?0 C( W$ z- m
; B* l( V: ?% m3 K0 F$ s9 U+ X, u* Zpublic class test {
" o: K. V+ G& I) {6 i6 u d c /**
0 S2 Q- G' Q- V5 H8 E * @param args
, {8 @* z3 l+ ?: g */
# y4 y4 t7 H; u; }% o& Q; i public static void main(String[] args) { h9 \) k" I0 H- S$ f
& ?- f9 [ a+ Y; C int y=(int)(10*Math.random());+ r7 u* R& [* T |- P! g) @$ F
System.out.println("result is "+y);
$ H8 @3 F2 z# j+ ^; P! j; n! s" S" X$ p1 P* y- f9 h
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);8 A. Q/ n$ E, f2 U! f. w
System.out.print(z+" re");# S' w4 h, b$ W& G' ?8 b* \
}4 D! U; K K( t7 {. t- d. X% |
}. ^) d$ U: q5 r* ~2 O8 P
- s1 s. s# B2 ?
结果是:& f2 `2 M9 j# C e) K
result is 2% k" A+ }3 p2 h) D
#
' v: _ y( K7 ~! g# B# An unexpected error has been detected by Java Runtime Environment:3 L4 f W; L3 y4 G/ b( |' ?' Q
#
3 r4 z9 e/ a6 \/ b0 b. U( M. j* E# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
3 ~& ~; a( I; [* g#
B O) x9 U5 t, ?# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ D; Y' U; j/ {# |) H* w, P. R# Problematic frame:0 O) U! Z' O9 h# o9 D. s
# C [javaswarm.dll+0xb8305]
% }% j. C' K c$ T/ o& t#. R$ K' ]: a* b( }6 N5 Y. e, o
# An error report file with more information is saved as hs_err_pid1064.log |