我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。/ R+ v4 N) ]' w* [
import swarm.Globals;! c* E7 n4 N7 I1 J+ [2 q$ M; t" @
6 f( ~) s$ z& c; b( ipublic class test {2 s: ^( H! i3 O L8 Q( M
/**, O: f2 I+ g1 ^- r
* @param args
2 c; o' @; r5 |% @' V4 z2 { */
4 E! c- g9 Z8 e& @. @$ y public static void main(String[] args) {
6 w( s' q# e. ]7 q . k% a9 z6 R8 v$ m0 F
int y=(int)(10*Math.random());
* n: c3 P4 L0 v4 }) D4 ]& z System.out.println("result is "+y);
+ S0 F! W ^* o9 I/ J+ J* P" T+ d( Q3 d9 H- _
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);; \$ D8 T0 f& g$ U+ Q" d3 i; P
System.out.print(z+" re");
' X: G- t0 p! f) }+ Q0 k9 e }
; c6 C+ t, u& I6 a/ @6 s9 r4 r}) `2 O7 Z+ e8 i2 s) \2 D
7 t! [; A6 w' ]" w7 W" r1 ]. n. g
结果是:
9 s/ s2 i; f: p" K2 d3 Y$ Wresult is 2
: O0 i$ X0 V5 n* Q#+ w. J2 O) ?% L6 I
# An unexpected error has been detected by Java Runtime Environment:/ v4 n* G# `( b7 O
## y- n, }! j I! l
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 L' s8 X# r5 q- W: N
#
! h% w* J, d" G" Y! f( [# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
' k0 A. h. t N6 @; O2 I# Problematic frame:& q6 a, |$ T d# Z# A5 U( J
# C [javaswarm.dll+0xb8305]
@+ A7 g! k0 _; g. j& _$ f/ H#
2 ^0 ]/ A2 W1 {" P/ G# An error report file with more information is saved as hs_err_pid1064.log |