我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
9 R* n% j' e& W6 i5 N2 fimport swarm.Globals;
8 n( m9 x( [7 E7 }3 H" X2 f6 A; q' g, ^
public class test {* K. W) k; k% u3 _. L- T! u
/**/ c. N% u" h4 D6 i3 z/ u4 j" `$ D
* @param args
$ }1 z2 b* O0 v6 k Z+ M0 N */
: y* }8 M& O1 i; |# O6 m3 D# [ public static void main(String[] args) {
2 Q. ^4 r5 w$ a # _$ a2 _/ ^1 G, u% k! c
int y=(int)(10*Math.random());
R4 v! ~8 d1 v4 v System.out.println("result is "+y);3 j; a+ R f! {1 r5 k! W
0 h* P8 U6 t2 E- T5 D \ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
# Y& k6 h+ A: w# z" ` System.out.print(z+" re");' n! W8 g. f) g. D9 \
}. S9 U3 ^: t, H( Z: @ O: |# ^
}3 t- s2 @+ B5 t9 ` o, g. D% }1 f
" c7 E" @ S. K结果是:
. q- E! _) H& t0 b/ K+ ?* @% K( Gresult is 26 K$ H9 f/ H7 _; p3 z3 B0 j T
#
" I) S) \8 [% b( R6 B2 Q# An unexpected error has been detected by Java Runtime Environment:
5 u6 x* Q% Q- L& Q x8 W#7 ?) x4 Y9 a+ ]% I
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
1 k) w/ \. w2 C0 E; l#
; K/ Y x, s2 U" G# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
( b" @2 Q% a# n3 {# Problematic frame:$ R6 M$ f m2 J6 O6 h4 l
# C [javaswarm.dll+0xb8305]# l# ]4 A& u0 ?, V/ C6 @/ s% Y
#( T6 O3 |0 h: B8 Z/ K# ^( g
# An error report file with more information is saved as hs_err_pid1064.log |