我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。, {& ?* K7 ^' o, t% j5 v/ R
import swarm.Globals;
( O. N" G$ ?" y$ l! G/ e- a. O' ]3 O- c4 w$ v: h% `
public class test {
6 _+ A) Q, R! }; D6 B9 K2 A4 @ /**
" M' f# {; z" B * @param args
4 t+ U2 A, f/ s) F */
# _' p2 U; m1 V3 S public static void main(String[] args) {
: z3 v$ E6 l" n- q9 @
$ |9 _& z$ Z4 y% T/ N# y) ` int y=(int)(10*Math.random());
0 k5 r4 c3 G1 c6 _- P9 `, Q System.out.println("result is "+y);4 ]4 X! Q: G1 |; ~$ e1 s
5 B0 F9 N: S0 r2 p2 f- j* F8 H5 N double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);$ m" ]1 H u) p, C: q4 ?) H5 a
System.out.print(z+" re");
8 E- x, ?$ q1 K( Q4 ~) n. } }; N& X4 v2 A$ x, ?$ Q1 x
}
8 P0 ~# u. |$ s6 ^2 S
6 r+ \4 i3 _- x3 M6 L2 L( ]结果是:
7 V6 u. s( y% Fresult is 26 [7 B8 A/ c4 c5 V6 _& b5 x3 I
#
' W, V/ s* }" H/ L% v# An unexpected error has been detected by Java Runtime Environment:( |2 Z" x/ l. U2 T- _& Y% i) @
#
( ^0 U* B2 x- U5 d8 ^# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10687 X8 w7 V" D( W6 x
#6 g1 e d% w1 M% b
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)% @. K/ S" r$ M
# Problematic frame:
: ^ V9 n) N6 @) f `6 s# C [javaswarm.dll+0xb8305]6 \$ f1 ~. _( j& C* D' C* Y8 P" X. q
#% O5 n; K; P6 H" O/ X( j: e' w
# An error report file with more information is saved as hs_err_pid1064.log |