我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 Z" J% g# L9 k* R* K+ jimport swarm.Globals;
; x/ V( f6 R% W6 ^+ b i- E( \5 [8 r/ t2 @7 W W- V: d
public class test {
: J9 L! I! B: x f/ x; J /**
: L4 U) k' e. O* D* ^& R- j% @, } * @param args
F! S) ]- E& E$ S: s */
O1 ]' j2 v: `$ P public static void main(String[] args) {
! y( s u, G( C* v3 f; Z ! r' ~; b3 u' Q }& c. U% a" U! l
int y=(int)(10*Math.random());$ p; |: V% ]6 F6 k+ U8 r& S: A
System.out.println("result is "+y);- { J: ]: n' g0 I7 N# U9 }3 v7 p
& }% K( R: }4 \% d6 g
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 g, g2 v7 y. z# ^: L
System.out.print(z+" re");7 C4 M6 P' y$ n$ w" M) n
}
- x, c2 i6 s2 V( N0 e x}
7 F+ D" s6 ^7 n3 t, ~- o0 N. K# a6 J" O) c! S' c8 ?
结果是:) W9 z1 _$ y0 T0 ^+ e4 c
result is 2
8 l' X+ K5 B! K/ F, z% a#- M) ~6 k8 N# y! g
# An unexpected error has been detected by Java Runtime Environment:% \1 M, y/ Y5 C9 G& G8 _
#
7 D+ U, R7 z! Z& p" g0 j# p/ p0 M# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10687 Z2 a8 ]# Q" @2 E0 y b% D
#
. H0 v& U( W) s7 K0 u2 D; ` R" S# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" T, J2 d. ]: Z# Problematic frame:
& D5 d5 g& Y* h# C [javaswarm.dll+0xb8305]' ?' N% Y5 S5 ~* w
#
; I" C: z, O+ ?0 l) [# An error report file with more information is saved as hs_err_pid1064.log |