我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( ^' ~1 A; h, P: [, Iimport swarm.Globals;
: q2 o8 s9 W) C' e
T% Y% O! J# }9 L; @) _ Gpublic class test {
& b7 P: Q0 V8 B6 X5 Z. @ /**, e( |* M/ t& f) a3 b
* @param args
) }" T: X& e7 \) \# z */
7 @% X3 h: X( ^$ b$ G2 Q! u public static void main(String[] args) {
1 u3 f, T- x7 X. z- k* n! Q G 4 k7 d: x" N: J. d0 @
int y=(int)(10*Math.random());
9 O0 X# C6 b7 N, s! Q7 S- w System.out.println("result is "+y);$ M/ A% V& L$ e- P
7 ^$ Z& U, Y: A: y6 P double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);" K8 D. U: k6 t# A
System.out.print(z+" re");
; d1 v: {% p' z4 `- V% ]8 w }5 i7 x+ b7 s7 T' Y" o7 j3 A( y0 [
}! i4 u4 V, U% E8 i7 E3 V7 ^
5 d+ Z: D+ P) `% {
结果是:
( }4 ^# ?0 l0 I3 O7 K7 r$ j6 N, Aresult is 26 ?; j3 K3 |5 l0 |+ U. c$ e3 _( J
#
3 _/ Q- c& e4 o% n% t6 ~: V# An unexpected error has been detected by Java Runtime Environment:4 ^- a, l5 x. ?
#
3 t: C) g% |$ M } H( r# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
" F: r- d/ k) |3 x#4 a9 s+ u- c& L, H7 m
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( g7 {# z4 a- W) E
# Problematic frame:+ x; N$ b) c$ t( U% R% k
# C [javaswarm.dll+0xb8305]
( H/ N# D( f+ O2 S6 S#
' `# ~/ o) w, {1 H/ d# An error report file with more information is saved as hs_err_pid1064.log |