我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。5 s9 _2 H; _* P8 U) i
import swarm.Globals;7 ?. b S1 _9 ?) y% j
1 `5 w1 d7 \0 o& C- t! Zpublic class test {
% S0 i( f% X. N% I Y% N8 g /**( z# f+ m# u/ i( |& K
* @param args9 S% |/ |! y4 b! ]% Z2 Y/ g$ D
*/- X* b4 | I4 }1 z4 k
public static void main(String[] args) {
+ f! U. F1 F g2 r- X: S0 @7 f
) X# w# P* R. e% R, r: e int y=(int)(10*Math.random());0 w$ }$ |$ O. s) g/ {, S9 N
System.out.println("result is "+y);
7 [! f2 H0 ~4 R0 R- @6 X8 [/ }0 _" p7 g/ l6 v" Y
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 a9 c6 r# z7 g# M5 V$ g
System.out.print(z+" re");) \; F- S0 F6 r. K2 b* R
}0 j! t: L# l) [0 c2 k2 M
}9 o7 q; B& [/ x+ O9 _
7 R- C3 a0 i' W7 z3 i9 J结果是:
3 A8 w9 K/ @& G. a/ m3 q& J- Presult is 2
& p6 G0 o. m( Z; z#( n" L# V! g4 S
# An unexpected error has been detected by Java Runtime Environment:9 V+ ^1 p! S0 j. q- E
#1 f7 }( Q& Q N# S. c+ I! h
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
# C; X; `4 F4 d' h#( y; h7 ?% A( |6 b% m
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
( S; [ g& ]; f+ c# T( u+ Y* \# Problematic frame:
) p$ B0 W3 o. G7 b9 g& T" Q. Y# C [javaswarm.dll+0xb8305]
1 h1 Z/ C" a. A7 l9 Q: ~: n- e## x+ ~3 ?6 A# |0 A
# An error report file with more information is saved as hs_err_pid1064.log |