我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
) r8 ~6 I/ `0 K# eimport swarm.Globals;6 E' L0 v9 E" y/ d3 a% E3 P& o
# P0 ^* G( n4 a* G2 u
public class test {* j! k9 h5 y- i# `8 G* f9 V. M
/**
7 Q0 P3 \, K5 k * @param args% S9 i) \4 L2 \, @7 P& V
*/
" y6 V% p' H& @# u- M public static void main(String[] args) {
$ G+ X/ o8 g1 z# l7 V# e8 B
! i. [' |& L: F1 `% Z, T int y=(int)(10*Math.random());9 J T7 {. T: D3 X9 ^6 I0 M8 w
System.out.println("result is "+y);8 ]6 Z/ h) j9 M$ p! S4 x u
+ S0 C5 E5 q: J& z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
% @! Z0 j4 p4 N# O System.out.print(z+" re");
2 o5 e- ^, n2 h M }( Z4 ]# W' ^1 A! |& F* [
}2 S' y4 @& Z# [
8 B0 M6 o4 y! u2 S# f# e3 s
结果是:
# z8 W- p3 S" S* p% ^: W" [9 F( l4 eresult is 2
7 [& h4 A* J, w#, d9 q9 F2 u1 v& L" i4 y4 C! x8 T2 ~
# An unexpected error has been detected by Java Runtime Environment:
( ^# D( |' c! ~1 N# w, w, u$ z* o, X$ Z6 h* |/ G
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! A0 M( ^9 `. [* ~8 i8 M! c
#; h% m) c$ r" N: l( M9 \
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)% _* K/ D% D' Y% g, D4 ]& B- A1 O
# Problematic frame:
& Y' V/ ^8 G, [5 y8 [, W- `# C [javaswarm.dll+0xb8305]3 i7 y) l- G$ s
#
4 I1 J" w" P( e4 b* b# An error report file with more information is saved as hs_err_pid1064.log |