我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( W+ V$ { R; x( q! timport swarm.Globals;
' W/ t$ O* Z- J& y! E [6 D/ U: g* g& G* Y( M
public class test {
4 A# J# f& \8 a8 X7 A+ ? /**" p& u$ o/ @$ c. `2 S
* @param args
, A) c4 A- e5 s */! K M' b/ r5 r- S1 ^- ]3 x
public static void main(String[] args) {
5 ?6 i/ Y! n" d8 S. K- k4 `& o& ~- m . e- K$ n% y* j) {9 \
int y=(int)(10*Math.random());5 G- c7 }0 _4 }+ p( [( A
System.out.println("result is "+y);( n1 {! y+ y( ?1 c& n1 r. ]
' _0 \5 d+ d9 Q1 |7 U" x* i( x double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
' g# G- H6 _" E, e0 Z. { System.out.print(z+" re");
' [. Z0 \9 r) C$ X3 Z" o" u1 _ }
" T l+ _ z# t# _% z7 T}8 d' D, O1 x$ q9 a
) S+ C z' [* \5 w结果是:* ?0 v# r4 O% Z3 i" D' l6 Z% R
result is 2
) S% _1 n3 ]) J5 v5 ?$ ? [) K. i9 |#& m8 Y8 s7 O" ^ u- o+ e% e
# An unexpected error has been detected by Java Runtime Environment:' ]2 c" S) z1 N1 {4 `
#
8 a/ H& J% {3 `6 _9 w2 w2 a# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( y7 O' B, n1 M+ h; o/ _#( q4 K. X8 H% `5 p! y
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ c6 J* S% I% `; R/ H1 y' f
# Problematic frame:
+ v; i* L. R1 E9 U5 S& l# ?# l! b# C [javaswarm.dll+0xb8305]
& u0 w3 B. }) b4 |# i0 D4 u/ q#
) X7 E5 J; Q& @7 K# An error report file with more information is saved as hs_err_pid1064.log |