我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
" \3 L3 A. u% |* Vimport swarm.Globals;; I' x V% h( n1 [5 T4 X
. U8 s' J$ L, `6 Y) m- N
public class test {
! J& K5 Q/ F6 s. K1 A5 g. y* h /**& p! _: G8 ?1 d" c
* @param args
5 k* A+ E0 H% G */0 Q6 q* b8 i6 d3 y8 `# G) a* m
public static void main(String[] args) {
8 _! [: a7 F* C+ k/ c. X) e
: G. J; b$ |- t! X' n int y=(int)(10*Math.random());4 B2 ~ w$ L/ u2 u9 G% u
System.out.println("result is "+y);0 @6 E# v/ n5 ?" Y
2 C" W$ ^0 ?! O6 s+ D9 U3 S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) i# Q: O4 R8 K& _2 T System.out.print(z+" re");
) |9 }* a. I* S0 B }
, W7 K. W$ a5 }0 B}( {% Q! }2 Z& A, O5 {$ W" ~
1 _7 v2 z/ X$ ~/ ]" G; ?% o. h
结果是:; a+ k- X& U+ Y! A1 ]
result is 26 Z$ V5 T& H. F% ]" n
#! T, X# Z; [$ u2 s9 K
# An unexpected error has been detected by Java Runtime Environment:
5 B7 M# f4 B* q) I9 Y( `( G#
& K5 s( l; v2 ?8 k: ~* \# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 o3 k9 U t( [0 L0 U- S; Q#% _( z9 I1 W. E* n9 G1 A$ J1 f' D, \
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& w; E+ j% l& _" o9 X
# Problematic frame:/ U' I* y+ j6 S, V R
# C [javaswarm.dll+0xb8305]/ X0 L+ z$ `& }: M+ b, u4 b
#
# f" e9 p- Z( N; P2 _# An error report file with more information is saved as hs_err_pid1064.log |