我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。1 J$ ~5 s( i+ O3 V
import swarm.Globals;
8 a, q* B" G6 ^+ M0 e
* @. Q p: V$ `! V# R8 S% N: o: B. N; Apublic class test {
9 ] S/ Q9 ~/ {: V* G /**2 e2 n5 H3 h ^7 c
* @param args
- b7 K7 k# d) d* Z1 w */6 }7 c% j2 E6 P) y) N
public static void main(String[] args) {7 w7 j, q2 |" t0 f- H/ l
S, N: x5 k$ w& q5 U# c int y=(int)(10*Math.random());
0 d3 E4 i" Y6 \" J4 z* G' O System.out.println("result is "+y);
. M3 V, Y o. T* F! q `. S0 \/ y: o' J! T# @9 E. l
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
+ U' D4 \. Q6 O3 s System.out.print(z+" re");
* H* k( f, ~! ^9 p8 B& s. c9 V }& V7 J6 @! a6 ^) ?
}
& s! Y, R& ? [ b
F( K" l6 }5 P; W& S: S. U) u1 ]结果是:; l. D. q; q2 d5 ^6 ^
result is 2: `4 v2 I- V, x
#; y$ R% l( ~& \2 W- ~1 A1 v
# An unexpected error has been detected by Java Runtime Environment:
# X: b4 X) @! Y2 t4 _#* r) C$ o% z6 f# \: o
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068' ^: P2 \+ j# r1 t' ]6 ^
#
$ |& q1 e' n7 i- F0 }! Q; J# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 ]5 G1 ]* V5 q% B7 i
# Problematic frame:7 e H% p/ Q/ Y, T0 w7 |
# C [javaswarm.dll+0xb8305]) |& W$ u1 `, |+ e8 J
#
6 g$ X) N$ m6 [# |# An error report file with more information is saved as hs_err_pid1064.log |