我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
7 O* L/ d( b z' U; fimport swarm.Globals;# M# K8 j! G1 Y2 c% R
9 w3 c! v& R4 A" M2 N5 E3 [8 g2 R
public class test {
5 z: J! n$ f; {7 P6 J' w /**+ M- } G: A( Q; P, b2 N; @: y
* @param args
# N' r3 q/ `8 {& J* T- t */
( w( q% h; `5 P/ Z2 M- M public static void main(String[] args) {
" k' K" j- V Z4 I6 ?7 K1 R2 i0 }) S
2 X, j/ H5 }+ c/ a0 x! P% ] int y=(int)(10*Math.random());* t& t7 {" }* r2 b! m8 ]% G, ]
System.out.println("result is "+y);/ a. i9 N* x, Q; E
0 d7 H5 u& n- a double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
; e4 B0 j1 B; Z8 l System.out.print(z+" re");" m9 n" q7 p2 z
}8 s) u& p! k* b: B; o$ J
}
$ m/ ?& c" q; R9 d& o* F0 A8 Y9 F' R( H U# t
结果是:
2 G* c3 S* b# b& C% K2 eresult is 2) j6 A7 @- @. f8 [( k: k
#5 g, t4 _, k$ V- b
# An unexpected error has been detected by Java Runtime Environment:
1 U+ d" v& G1 Y1 t0 t: A#0 P' Z3 I1 }& Z; y& N5 L3 u% T
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* {5 a) r" N4 l5 C5 r. X# _5 G
#
: ]$ y& a9 i2 I# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& m- b: g' A4 [2 F6 J( |7 y# Problematic frame:
% [+ N+ }' s# R: ^9 [# C [javaswarm.dll+0xb8305]
2 e6 t3 {" }# K, O I& C#& E( I F- r [
# An error report file with more information is saved as hs_err_pid1064.log |