我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: H& L# o& Y5 O2 Dimport swarm.Globals;
9 g5 M/ L- D$ r: n5 I* F$ ?
# j+ h2 p) j4 P8 f# D1 J+ g$ z5 ipublic class test {
$ {; T8 p/ z6 V# E6 o( w! d /**2 b7 f9 s4 o& g
* @param args
7 h4 z7 W3 ~" ^ */
5 b4 P+ [) O% s) H9 F. R0 v8 z public static void main(String[] args) {% z/ n7 W+ H2 S% ^* \
2 s8 t& R- [- @- v
int y=(int)(10*Math.random());7 L& ^% Z6 `/ U- f: U/ e
System.out.println("result is "+y);
" R- V; S4 ^/ N1 N7 ~! ?: g; [4 p
- L) Z- I( v3 p( s9 @ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
6 I9 c: H2 p# Z System.out.print(z+" re");
# f) a P( `" b' v3 ~& {' l }. p6 |& I4 V4 b& [) I* y! Y
}7 P0 t' v V& I
/ h' [' t8 P. e* s& F D+ M
结果是:9 ^! c$ ^: `% G' D9 G5 x' H# g- O( I
result is 2
' x1 i2 N5 g, O% v#! o4 {6 J: P" Q% v1 t
# An unexpected error has been detected by Java Runtime Environment:. F- ?) c ^, \2 ? @( `4 S" u- ^
#0 V) @1 s6 O: M$ r2 o- G, C
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10685 g: `9 h! A0 r. t
#4 i, g3 [8 y' A* W+ c7 a
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 A! D# S! A; M
# Problematic frame:1 q& z, f$ m5 Z6 U- E7 b) t
# C [javaswarm.dll+0xb8305]
- ?# |6 k1 {. l4 b. J( O5 f* B#
8 `' N1 c% j* D" I$ ^! L+ X5 ?; G# An error report file with more information is saved as hs_err_pid1064.log |