我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- C3 X( \+ I8 k, n+ ]1 Limport swarm.Globals;( M5 X" @0 [3 U( o, w( l
0 Y, M* \7 y. B0 b/ Bpublic class test {& \6 E0 ^ O K
/**/ ~; W5 J _8 `% E5 M
* @param args0 P& _( P& P0 ?( F- H& m% X* C
*/
: m! W7 l$ C3 \ | public static void main(String[] args) {
" y/ |6 G- ~1 U1 }
. I% L; U/ l: D+ D ?4 b int y=(int)(10*Math.random());
?; c+ G: ~8 ]2 p9 y2 k System.out.println("result is "+y);" V- C9 c3 @# i% p
- {3 D6 d9 K- n. ` double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);5 V& k( Z, B1 r3 U% | f
System.out.print(z+" re");
. }1 r$ Y: U2 R+ `- c7 ` }. B; S' [/ U* x. \1 E
}
) b P6 O+ X+ k% ^7 d# i2 [/ H5 `! C- d
结果是:
# F7 t: u; a( z7 hresult is 2
7 ^( ]. V! `) }$ G3 k/ Q" Y @5 [#! d3 r+ B) O7 i) u; |
# An unexpected error has been detected by Java Runtime Environment:* B1 O" Q' y$ e) N* k% ?
#$ L# h% P$ J5 U, _( [/ D
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
2 \4 W" K& t# Z8 l#
# A' k" Y' q5 f8 f" C' y( J% g, w# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
2 {- e2 b. C8 h" G# Problematic frame:; }7 z. I. b3 B& V* d
# C [javaswarm.dll+0xb8305]
1 N0 ~2 G8 |0 @6 t" V$ k( [: ^#$ m& E R. @' ^0 q1 H8 _/ ~
# An error report file with more information is saved as hs_err_pid1064.log |