我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ o) j1 T& I$ v# ximport swarm.Globals; b5 W8 a" O6 ~. n8 q) L: f1 v4 V
1 C7 J# r* k0 @9 O! Epublic class test {9 r. v4 r6 l ?. `
/**+ l$ c% S& W/ U3 t
* @param args: l. g1 ?# f: c9 Q+ x; ^, f0 l* R
*/
2 g0 G7 c3 }1 l) T4 |- [- a, |7 z public static void main(String[] args) {
* T( d8 z4 r4 w
8 r3 n( B R( i! i$ V% P7 n& d0 Y int y=(int)(10*Math.random());
; I2 ?% A, M6 W System.out.println("result is "+y);
+ Z" g- L, F. x: w' G1 `8 A7 ^; j/ G+ N1 W% G4 I7 L
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ B, H0 d1 w) {) C: l+ X
System.out.print(z+" re");
* ~! H+ ^' B' m, a ?# c }7 y( A0 A2 @; G3 [ Y2 i( C
}/ H; s& {; c. J) A
- V k$ M9 X( X/ R
结果是:
* K) F6 B5 g5 W; d% `- mresult is 22 B4 r( c c' d/ _4 [0 e: n
#' p2 o: k4 l1 C7 p& [* Z
# An unexpected error has been detected by Java Runtime Environment:
6 L2 e9 A$ v, U, h2 _$ A: ~! r9 S#
+ S2 x! W6 k2 m* D2 f% I# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
/ d1 b8 G& Q. Y B## l3 R9 Z4 u) E- `4 y d
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
8 `: C7 C, L) b$ _! d/ X* R, x% H# Problematic frame:
; S6 X# i9 K' z% a# O# P# C [javaswarm.dll+0xb8305]
* w; z X. k ~6 \/ U$ ^* R+ a#
7 C3 \9 E& t+ f# An error report file with more information is saved as hs_err_pid1064.log |