我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
/ ]' e y: }3 r+ j, j' h( C% Timport swarm.Globals;+ }& F, e" \$ F% Q
8 F5 j6 `, r! U5 y1 H* t
public class test {
9 s! `& B" I( ~$ o5 E" }( w! T /**1 l; S( w2 s" G# n. c. ~
* @param args; m, t+ G3 w' c& f0 C
*/
. X* x, n4 u7 ^7 S public static void main(String[] args) {
+ G7 y* C5 y: Z+ x2 r$ p, r
! k" r% h/ A, u! Z( { int y=(int)(10*Math.random());" }1 O' R7 `$ ^! }3 v2 C/ f
System.out.println("result is "+y);
$ h9 ^% r/ s; @3 _* i+ u+ G/ N; R, M Q; K
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ W6 D' O) y9 L) `1 h$ s System.out.print(z+" re");& [: }1 `/ S }& s
}7 p$ Q# X* }, c0 ]
}- o' u/ ~% J* k# R2 c. ]
6 F4 G8 M% J3 b) V
结果是:
, v& h. i3 T: I1 \8 e2 J# Y1 G3 Zresult is 2% e: V+ z! R: _( w( z1 T
#! ~" e1 i5 Z7 D) w; d% `$ L9 b
# An unexpected error has been detected by Java Runtime Environment:
8 g1 i+ }# a6 t#8 F' w. h3 ]1 Q1 L* @
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
, |' U* [" Y! V. m; T#
. m4 @, j Q4 {* R7 B+ G/ F# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)* i6 D/ n$ R s2 [/ @
# Problematic frame:. O9 x( C. d/ R% Z
# C [javaswarm.dll+0xb8305]2 \ L" T- l1 i" J$ ?* d
#& [3 {% R) }' i# b2 l
# An error report file with more information is saved as hs_err_pid1064.log |