我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。# {. q/ \; x$ ]
import swarm.Globals;
9 U% C1 Y( Q/ ]4 L7 ?* Y# S& ^; I9 x5 T' H+ K# X
public class test {8 \, ~" w# |- o, ]( l8 G
/**- `! \3 w& V3 d# Z8 m
* @param args
, g& c- ]( Y$ `. H/ \6 Y) g */
# h) o1 x) \& M" h4 B3 U public static void main(String[] args) {
$ ^$ ^, k- D7 I0 Y1 _
2 N/ [9 H$ }% J1 X9 U0 J, p- q int y=(int)(10*Math.random());3 |( ^6 b* C- c
System.out.println("result is "+y);
* H9 Z% g7 w! m4 Q$ }! M4 s' z6 d0 s5 j4 f" h1 ]2 n
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ ^: e% l5 U% }, B0 b9 I
System.out.print(z+" re");* O+ }' _+ B' I
}, R9 q7 a( d, |: e2 Q
}- y* K5 a7 J) T
4 ]# H' M x# K- m
结果是:
% v( M9 _* ~1 E9 I( fresult is 2% Z9 w) G/ n( \# m, n$ O
#
, B. _8 m8 K) X- ^# S" a3 @# T* j" J# An unexpected error has been detected by Java Runtime Environment:
, c4 B; m- S3 |4 @1 U/ V) t#
" J( [ m# Y9 f7 O" X# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10680 O" B! L: w: n5 d: g
#
6 N' _) B/ w Y" m1 _# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)$ d, }* W2 ^: k; x6 U3 g$ {
# Problematic frame:
! Y- b6 L7 j3 U, l1 H6 B# C [javaswarm.dll+0xb8305]
8 z: Q3 d& `4 h' |( v! v6 H#
/ n* O; x" Y4 O: x; P+ ]/ L6 C' ~# An error report file with more information is saved as hs_err_pid1064.log |