我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ F# y8 a1 Z0 e( m# b, ^import swarm.Globals;" `( K0 _* z# P# d2 x6 {
7 X5 [) W8 |% ipublic class test {
) G, k# A1 K1 h! j+ ]5 I& T /**
t7 _& U4 H7 Q9 I# y8 y * @param args3 ]! P0 J# `4 }# v+ r
*// m* O8 V- P8 H: }. T' z
public static void main(String[] args) {* Z; `! P- p. j' O# C* N: @
7 k$ D4 Y% r1 x; c1 ^ int y=(int)(10*Math.random());0 h: Z7 M% h3 t
System.out.println("result is "+y);+ J: C- R4 t5 i0 ^5 ?+ Z5 v( y% ~
- U' x ]& y4 { K$ B6 B! i& R9 `
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 I; F+ a3 y7 r: i3 d
System.out.print(z+" re");( Q2 \- B& g0 J9 k# y3 x- }) f
}
, G# j _0 p" L* }$ i% ^* f}8 @# t/ O% v6 T/ g! s! y
$ U9 v" F/ M4 f结果是:
% V7 i, e- f! q9 d+ i& iresult is 20 K/ U1 d3 o+ I V( e$ k
#& N1 Y- r$ ?' r; \
# An unexpected error has been detected by Java Runtime Environment:
, @" e; k+ k2 b#
: h0 a4 p" c$ W. ?: X# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068/ U/ \: x7 k7 A, Z3 i# `; g
#
W4 W3 O6 w: E1 ? y' r ]# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ S6 b, D$ }, F }' M2 o1 s8 e
# Problematic frame:! V4 Y; ], C8 S$ [
# C [javaswarm.dll+0xb8305]
& A/ w3 O8 g( b#7 T) y1 K o1 y6 z
# An error report file with more information is saved as hs_err_pid1064.log |