我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。; S5 y6 Q, H' i `0 {' G0 s
import swarm.Globals;
7 t" s8 H) s6 r$ {; f7 z h, I2 I" f# Q G( L3 W
public class test {( _* \: |) x5 H+ p
/**7 E$ \/ A& d6 k& g! a
* @param args+ F/ r2 o! N7 N/ M! u
*/- ?: |1 q$ |$ Q+ R9 E% V* t
public static void main(String[] args) {6 j! R' R$ u3 `0 f( L4 O' L7 i
" G) j$ m0 F& {- J; }8 i int y=(int)(10*Math.random());
4 U! w7 h4 n3 } System.out.println("result is "+y);& u/ a H5 ^3 q9 u
8 y: Y5 e! L" _+ l double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);; y& K {" @0 l- d5 `8 _8 ]3 F* x/ t; |
System.out.print(z+" re");
/ w/ m& M W/ }7 V) E2 h+ x: ` }+ ?: Q3 ]8 V) q2 J- A; F, ]# |* t
}
4 ?8 R5 r, @/ L/ s5 }. j* M0 d' h$ [1 t
结果是:! e0 E$ T3 b3 N& Y/ A
result is 2( ?" O1 V" j) R: q4 @
#
3 {( p! Z c3 h. R" D6 }# An unexpected error has been detected by Java Runtime Environment:
$ g) v4 s: |& y" z0 k#, V7 S, H& ?: p0 B. S, O0 e
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
& n- M' g$ M% X! V#- r$ z) ]$ p3 p- P5 s! w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)5 f4 `( V; p* C6 y
# Problematic frame:
r5 F ?( {' H# y# C [javaswarm.dll+0xb8305]
1 o& Y7 ?+ d7 V4 w d! N h#
. T( V' X; d6 O2 V# An error report file with more information is saved as hs_err_pid1064.log |