我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
# d1 e3 h% Z; a2 b! X/ oimport swarm.Globals;
" J+ m! _' Z8 E" D; T* L, P4 s. V& N0 v3 W F
public class test {- l% D! ^8 R: }' P
/**. Q% K1 s' w7 G( R
* @param args$ B! k) g3 ~ Z8 A/ c
*/
! M4 l; y( [" f% H5 T& L public static void main(String[] args) {7 f9 ?8 i3 @4 X- A" M& V
2 `( ]: k$ P9 |8 ~1 J" r+ d" t
int y=(int)(10*Math.random());
; X8 A0 ?$ X) e System.out.println("result is "+y);& X$ t6 y" j! Q$ R/ x8 N4 ]
2 q& o4 K6 F$ U9 y' M2 G5 [ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0); d4 T I$ [! Z; O4 v" P
System.out.print(z+" re");$ c4 a) H+ O1 t+ Q4 Y
}; ~ a- Z& [0 g& \4 H9 S) _
}
( ]3 d, N3 q- A( \6 [9 L
1 K1 { c0 ~, c+ w! v7 G结果是:
) }* L) _, y4 Gresult is 2
' h2 w/ v4 q7 e0 W! y S9 M; S e& ?#5 ?0 g1 p) b. a) H, V
# An unexpected error has been detected by Java Runtime Environment:1 {( {8 l9 ~6 o* i) }- a9 x c
#5 r5 o# i% T3 \7 q
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068# a" G c( m! C6 o
#
! k9 b4 O" X) ?$ {# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)! R7 j) D- F& A1 k" N
# Problematic frame:/ h. o w. f- ]2 y
# C [javaswarm.dll+0xb8305]
5 G" l) n8 [. C! q: U# R#* _1 ^8 ?* W. k; s/ P7 |: {
# An error report file with more information is saved as hs_err_pid1064.log |