我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- o1 `6 X) x# Wimport swarm.Globals;
8 r0 a$ N! m3 w+ [2 c, B/ o2 \- A- O6 c5 Y. {' j
public class test {
, Y4 f g4 k* _; o6 `4 H /**
( Y# R6 }6 g/ A3 a+ S/ r6 c9 h- b * @param args% ~ s& y( D( A1 p, u- v
*/% V) r. D9 G; z3 _8 `
public static void main(String[] args) {
$ P- ^0 q; j7 |' ^
O6 A. Y5 s- k1 ~7 @ S5 i- d; ? int y=(int)(10*Math.random());
- P" {7 J- P2 Z8 A1 g; Y System.out.println("result is "+y);1 E% M8 N. g) Z7 Q: n+ g. ~& ?
" T" \) e5 _& O' _4 D
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
2 W" o3 K' s( W System.out.print(z+" re");
, X8 j/ {3 x* H }
% O; {& }0 t) ^$ ] [# q}
8 M& J ?1 j; d
( l' w0 H2 ?: s) h% u, X结果是:
$ }) y8 a9 I/ t1 j Q8 b* |) kresult is 2
: Q( B* n( ], P; [2 A( k7 O5 q, a) d#: o( S, o9 X; i6 w1 K% Z- U; }2 V
# An unexpected error has been detected by Java Runtime Environment:- L$ J8 R5 f2 ]8 ~7 b, `
#* v- Q J. ]! M6 F/ K
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068& o/ e r0 U. F4 X1 k
#; K* v9 e: N8 r. l
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
0 g0 O X0 L( h% H( o# Problematic frame:
: j% i6 g- r( Q5 R* B! m/ U# C [javaswarm.dll+0xb8305]4 P4 S- _7 ^4 U5 Y
#$ M4 r: Y+ ^6 t2 H
# An error report file with more information is saved as hs_err_pid1064.log |