我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。- r8 N: ]6 @* R. n; d3 Y
import swarm.Globals;
9 ?/ {* C! z, O5 z' ?; V+ Q! k: F. S' X6 a ^
public class test {
$ `+ u" a( h3 d6 u& j; c /**9 F$ e( p* l5 H2 ^1 @. X
* @param args- r1 s7 |. v, M) Z ~! B! e" ^
*/
3 [3 E3 `1 e- y. F/ ~5 j/ H, ` public static void main(String[] args) {* F3 ]9 `; g) e5 w+ W2 u+ ^
6 q/ I( e$ a3 w6 x* L' d int y=(int)(10*Math.random());. t3 k( h( w3 |2 z
System.out.println("result is "+y);+ a) T! ^2 ^) k. u! P: C: x5 ^
. ~( P* R9 P3 O o( E
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ [! @+ H2 w3 g/ I5 ~' D
System.out.print(z+" re");" V1 i# u _6 @% x+ l
}4 U/ b# a/ t- j$ Z( s
}
% [4 J( K% {5 g/ q( F3 A& ?9 J* K3 |8 K" r, j) o
结果是:" m1 A/ Z4 w, i" {8 ?0 R& K
result is 20 S8 g. i i- i: r% I1 b' u
#
) ?, X# x, _# A) \9 i# An unexpected error has been detected by Java Runtime Environment:
1 x2 u1 w; q8 r7 d% c& g! p#
* r6 H% I5 E: N) h# I% J! g# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
- A: d+ A C4 I6 \* X9 u7 W#8 N& s" s" f: {# X8 x+ H
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- m2 y/ Z8 X: b) j& p# Problematic frame:
4 f' P1 W3 [/ h& N' b/ @% h0 G# C [javaswarm.dll+0xb8305]/ W- d, k* l y& c4 w/ J9 W
#
2 _4 ]4 {6 X5 K! {4 B$ p# An error report file with more information is saved as hs_err_pid1064.log |