我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。8 ]( f; ^, V5 I
import swarm.Globals;1 \* G, \) n( E5 Y" {6 w
) t* y$ x$ Y1 V8 Rpublic class test {# V. `5 N- }0 v! U
/**$ `2 a& e) g* Q, a+ w) d+ ?4 q7 b
* @param args1 f) y) E% v$ G2 d1 ]8 w) j
*/
1 G. ^, {, }( ` public static void main(String[] args) {9 ^( x1 H# m0 P) N7 U, l
! ]+ F8 s9 s4 p: h/ D4 s. o( ~ int y=(int)(10*Math.random());. \4 f. a' ^3 Y4 ~0 k/ u/ A" ]+ _6 P/ X. ]
System.out.println("result is "+y);
" ?1 y& A0 C* ~6 g8 e% Y9 `/ G* J: z
, @5 a0 [, c X4 y; S double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);2 b3 `! |" K6 E' J: ?+ [
System.out.print(z+" re");
5 Z1 X* w5 {+ o, q, v }0 m* E; H( k3 ]. ?7 n0 I
}
) s2 s9 z; N( N( J, e; E7 z) s4 O* o% H
结果是:+ B$ [- Y% _ w/ a' p$ I0 |
result is 2
& q/ @* A/ R5 d, v- T#
( _& j0 |, S2 M- y# An unexpected error has been detected by Java Runtime Environment:7 K: y( k7 ^6 G. S' V
#
+ F A$ ]& V' V0 e0 A* G1 E# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: `; H$ a& {' B1 p% W, i#
2 g/ j, c8 @, ]6 f& p# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 h: I9 r3 x' h4 H
# Problematic frame:! t$ x% z0 z+ t% ]- }9 W* c5 L! ^9 L
# C [javaswarm.dll+0xb8305]
/ s5 z) D/ ` D$ z8 m#8 ?0 P: E# n9 |' I9 |! i
# An error report file with more information is saved as hs_err_pid1064.log |