我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ Q+ ^0 N5 A* u# i# u! q zimport swarm.Globals;
0 k" U0 @! I) L" g2 `( |. h5 X$ ^7 |3 Y: z9 x# y
public class test {7 l X6 e8 c2 ?) w; y, l7 _% |
/**
4 U: E) E8 x! e6 M * @param args
% U; Q8 j* M% x3 M* Q */
2 B% H3 L8 @- M) }) V public static void main(String[] args) {
l2 S, H9 S, ~. ~ , G3 P, Z( Y) T/ P/ R+ ?
int y=(int)(10*Math.random());
3 q3 v) F) D7 @* e* E System.out.println("result is "+y);6 }, ?% U8 A% y) J: E: k
" S9 T. p- d9 _: G4 G y
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 S$ M6 k+ X! v( l
System.out.print(z+" re");
- z3 f' k; C' Y) C+ f4 U. ?. t }
9 j3 c& r: u1 E, k( C2 O' j}
1 N+ f" \ m; G2 R
$ j. J- s; X2 v* l! T( N结果是:
" ~% a% j5 V J# X3 Aresult is 2! S& G2 s8 _; y' @
#/ Y8 h4 K3 N4 { S0 ~( \
# An unexpected error has been detected by Java Runtime Environment:
* Y3 `4 J2 n8 M' N* L6 t; m7 U6 b#
' |9 B/ d* c4 d$ p! b! X# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
9 o, S ?+ b+ Y6 l#- ?; i5 Y9 A. H# Y
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
3 i# ]# Z6 i2 Y# m3 P; N+ m. y6 I# Problematic frame:7 W: z6 e1 C5 d
# C [javaswarm.dll+0xb8305]+ G: i1 q4 S9 D& |% ^0 C+ b( y9 f2 O
#
6 v5 r b& S- d, }1 p `) w) w# An error report file with more information is saved as hs_err_pid1064.log |