我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
, W. s, e* w, E% Fimport swarm.Globals;( s: U8 E) w* t2 V/ _- g
2 N! E0 Q0 @$ a- ^ l
public class test {3 ]) ?' A; V. i! w3 w% |+ W
/**
, b+ a+ S0 }* w# \$ z, p * @param args
* v! S" B' U: h( D */
0 B, ~# L& H. [9 P public static void main(String[] args) {
2 t0 w3 s) w# a+ @1 V6 R
8 b! v; x) a# d1 T0 c6 c# E int y=(int)(10*Math.random());& s- c! K$ G+ T
System.out.println("result is "+y);
# C( H# N4 F4 c& Z( O9 W% ~8 m% Y+ ?$ f* M
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);* ^: p6 i/ C/ G+ p: d/ q
System.out.print(z+" re");
f8 A! d. h" t7 R0 Q! I6 n( y }
$ \6 E3 Q5 q& C& P& S6 Y) S}0 E/ z- c7 f/ A
+ p3 \8 [% E/ n6 s$ Q4 q结果是:* w& o" Q, m8 W2 ^' J' X9 [
result is 2
1 M, P& C3 l3 X V7 N# X$ Q% _#( { r4 X# [) m; E6 r6 y
# An unexpected error has been detected by Java Runtime Environment:
& @& y" ~7 [8 W ?& K' _% O* ?#
/ f1 h/ q! Y. K; K" Q+ X4 W6 ]& I# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
/ j" R$ y# V6 f7 @. v1 B4 H9 Q#2 Y( V9 d% F0 A8 ?$ ^0 w
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)4 l' J8 b! J; X$ l" X" r
# Problematic frame:: }- W% S- F. r) k
# C [javaswarm.dll+0xb8305]' a* K& E) ?( v( m" J
#
+ b. S) A) z0 _! \5 H$ p4 j, i; A# An error report file with more information is saved as hs_err_pid1064.log |