我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! ?1 J. r7 S6 O) _6 p9 V3 ?import swarm.Globals;. D; ^5 P; T* b: ]3 D9 M; ?: q2 m* E
' J" [: | I1 m, gpublic class test {
- ~6 |% H7 k# C) h" Z2 q: c* E; ~4 X c /**
. D! r1 L) Q# _( e) F, ^ * @param args) @& t$ z% ~9 m6 Q ]9 g% O" }
*/
% b' ?" |1 e2 W" f- n, S% l f public static void main(String[] args) {% l. d. c6 |6 f7 v
2 R `+ J! C1 a4 j( | int y=(int)(10*Math.random());$ g* I: a9 O8 r- A ^
System.out.println("result is "+y);. {" K/ v5 q8 f( q
( H" f q% ^) A& f4 P double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ m" {! Q7 B3 I0 D' L3 @& `
System.out.print(z+" re");' U* ?! y6 U4 N0 P" A
}
" D% N, ~+ Y, ^; g$ W0 q+ R}
( e( Z ] @% a$ X/ Y) }! i3 ?7 o% P% c& Q* B& `4 ?8 o3 Q# r, D3 v
结果是:
) S2 a4 w% A- n% u' c* i n1 H1 Nresult is 2
: t3 I% C1 E% c3 J8 ^1 W#8 ^+ u) ^0 q* R! w
# An unexpected error has been detected by Java Runtime Environment:( A5 O5 U, \8 o5 E
#: p/ a' ]( J: p2 |9 Y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 c/ q0 `0 T4 b- O0 I+ S& ?# P
#
, o6 m6 l4 Y: ^' i# D# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
/ g, Q) F3 ] P8 _+ P# Problematic frame:% `- N$ A" ^$ \# }) ?) J. Z2 w
# C [javaswarm.dll+0xb8305]
0 q" ~( k4 e3 m2 j. B2 p- O) [3 t! V#6 N- I6 a0 x1 n; u5 A2 X
# An error report file with more information is saved as hs_err_pid1064.log |