我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
0 N( F3 P' x" X9 k# Cimport swarm.Globals;
/ `1 d& c! n' q s2 I( }" X
+ b- b- ^- r" e3 L0 hpublic class test {
( y# D9 ]5 y [0 u" ]+ d1 f i /** r! _9 G& W: V) F$ C% v0 c- f* y3 {* {* E
* @param args
) }# P# [! B/ W: M" P# e; y% W7 t */! `. `# C2 W% j0 h
public static void main(String[] args) {
" q/ t( t- ?; B1 [* l
( P; Z3 b8 f! t' t1 b& h int y=(int)(10*Math.random());
3 x- O1 \7 `1 _3 y9 N: f; K System.out.println("result is "+y);) A9 e/ M! P' e0 z" s9 U
# d) L# [) r9 {1 o5 C2 M- e. v: l double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);$ c+ \ O+ L" J" [/ p3 b
System.out.print(z+" re");2 u8 u& w) i1 G2 E8 Z' ]& n- O
}% Q4 q" ~% `4 z. W \
}7 H$ o; e- f- N
0 J; C1 I7 G& V/ r- M结果是:
& f7 Y. z' p4 ?% R# o4 p+ Bresult is 2
4 N! B! D8 I! r7 K/ i: _#* W/ O' m- ^) U2 B7 l5 ?
# An unexpected error has been detected by Java Runtime Environment:
/ W7 T" z0 Y, Z5 S# `) t## v* a0 }) K5 k: Y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068+ }- D$ K. R9 T$ M A! }0 b
#
+ J1 S' g V6 i/ ~" v# i0 ~# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& d5 U* P3 C# G$ p# Problematic frame:
, ]4 x. p9 q% d* Z* Q) ]0 v# C [javaswarm.dll+0xb8305]8 h' b& i5 ]" e! k& m T
#$ o0 H1 w4 D5 Y9 v. n& ?
# An error report file with more information is saved as hs_err_pid1064.log |