我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。, c1 @3 c$ |; u- s5 T8 f5 a" S- w
import swarm.Globals;
6 I: B( I: p% F& T1 X4 D8 h$ g5 v
public class test {7 F, V8 r) S1 D' A: ?
/**+ w2 d. B# n) a. n+ q
* @param args
" D3 c7 C! B" t T w */) l* H& s& `% V2 H) u
public static void main(String[] args) {" k( k" [* Z D5 w3 J/ e
2 ~# c6 W1 Y- @; Y, p4 T: I
int y=(int)(10*Math.random());3 U+ _# C: q* m7 Q# s+ [
System.out.println("result is "+y);
+ C0 z( Z# O% ~0 ~& v j: w/ u( _5 v6 C3 U, Y9 y6 I/ ^/ }
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);9 \8 @# u8 q3 q" x+ r$ ^3 v- [# I
System.out.print(z+" re");
" D Q; n4 a w5 Y8 u1 Z V }
$ j2 o# d3 o5 c( l- ~4 w6 g- M}3 v0 E# k* r# `1 g5 T
1 j# O8 C H- }1 q# J% C* J
结果是:2 s. c: t; D' d1 h# m4 d" f, [
result is 2
4 q1 m2 v. w) \! [+ q) x4 ]#
5 @2 D0 b4 P* Q$ h& E# An unexpected error has been detected by Java Runtime Environment:
! m+ O2 M! e% S# u( h$ o J! \
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10682 D; T0 p, `6 U6 g+ F( z. }
#
% s1 ~! k# W: ?0 r* H; G# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
4 D$ m( l" c- D" B6 @3 O) U2 c# Problematic frame:" \) r& g; b( a2 f; p9 q# R2 o
# C [javaswarm.dll+0xb8305]
5 P: p" a. v, M4 k4 y# W$ H#
/ p9 M3 ?, p3 y% w/ t# An error report file with more information is saved as hs_err_pid1064.log |