我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。0 w9 h+ ]) Q, Q0 t
import swarm.Globals;
9 x5 ]3 H6 `/ k; r d! ^( ~/ o, o2 ^& I3 i
public class test {
' G: p2 ~' l4 V: m2 _3 @. Y /**/ X g! v4 F/ }! g# B9 [8 P
* @param args* {' ~/ N" g1 G `3 F# w
*/) |3 S+ s( Z9 `% t
public static void main(String[] args) {
6 t: ?3 Z& ?* v7 l6 s1 m% Q
+ {9 v' r4 R% x, z' R+ A3 [ int y=(int)(10*Math.random());
) i4 A5 W" x0 M System.out.println("result is "+y);# y) P* I+ e2 |, s6 r, K
0 z- `& w: o0 j: |6 s; ~ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
& C8 n$ ~" k. z j System.out.print(z+" re");% C( k6 p" F5 J3 h8 U: ~: S
}
5 H, T0 O- T5 s, e0 u8 [}
6 l$ x" x& V) Y9 ?6 Z4 H( \. T* J( t$ F1 ~; i& b
结果是:5 }! B, W4 X7 ^
result is 2+ s0 U3 J: j$ ~
#
* D1 T0 U# d% J6 B# An unexpected error has been detected by Java Runtime Environment:
7 ~! w+ J/ T9 H) A1 r( N#( f% s% l& j0 s3 X
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
# Q6 |' @" g6 ~6 a#
$ x9 M1 f: {2 J0 ^8 i# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)0 F2 s q! G* x
# Problematic frame:
( C7 _! |! n) L# C [javaswarm.dll+0xb8305]
' r( j, P- b4 n7 F0 a B6 N+ I0 @#
0 O, M; z+ R9 z* K5 T) {# An error report file with more information is saved as hs_err_pid1064.log |