我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
: Y# b) d5 N. G) y- t9 ~5 _import swarm.Globals;
$ X4 E1 t8 |/ j+ F/ @9 O d; O5 h" \; w
public class test {1 V: d# ~# n K7 {
/**
2 n. O9 h; h* P) I1 d. N * @param args
1 ?4 S& S* R( ?# T( b$ {' ]0 d" P */
) I: E) G, ?9 X: \7 u- Z' N+ ? public static void main(String[] args) {2 N/ N8 B0 X' c8 [2 k1 c
7 ]" ^" ^% m3 V& _. s2 K
int y=(int)(10*Math.random());
( }% x& J* H+ P! N9 v System.out.println("result is "+y);6 G" s k! Z) Y: d; X5 g; k1 W6 s2 Q
: J3 n: p4 M* ?. q( k
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);! [9 t. ?/ C% ~+ C- J9 f
System.out.print(z+" re");2 L8 l2 a, f G8 I% |% y; i3 y0 C
}1 p2 l% M* I O6 F% H
}
9 D: l8 ]' S( q+ V6 Z( _( ^7 y+ j8 A3 A0 u5 o8 x6 h
结果是:( u: M3 n( `. G; E" X
result is 2
2 }+ \; B& p0 u/ h#( y6 H* J. i; e' A& O2 e/ ~
# An unexpected error has been detected by Java Runtime Environment:
* g7 _6 j$ N, d+ T; u* N#
3 y2 x, `! c% w/ n# b0 z# J* [# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10680 M. O' _0 B0 W# f: z: U
#
; b9 p. c; `& x1 g) @ C9 F# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)0 _- Y, Z; F+ [9 M. o
# Problematic frame:
- _9 @0 a/ n/ K- S6 a/ g' d# _: A# C [javaswarm.dll+0xb8305]8 G* }9 w6 |. b. n; {! A
#! E: q. i2 J& P, }8 c* i
# An error report file with more information is saved as hs_err_pid1064.log |