我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 h# ~. t2 l+ n% H- Z2 R7 L
import swarm.Globals;
& H# [6 |: ?, E! i$ a
# R0 B3 P. G6 Spublic class test {
1 H8 _7 A% {3 G1 B+ v! _5 E2 B /**
5 o4 U% M3 x. b" h; |: d * @param args
1 o/ G8 H0 c# Y# C */
, E ^! c- S S) _, W/ w8 c public static void main(String[] args) {
, V+ M$ Q/ p- d5 W7 I 3 r/ S- O* q+ Q1 B# S8 b
int y=(int)(10*Math.random());% u0 B, h- ]+ S& S, n3 F( y
System.out.println("result is "+y); L9 }+ ~; H% L# F' b
: X4 y* R9 s) f$ Z \/ ~' w
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
# F" x4 B% } Z System.out.print(z+" re");
. y8 T0 |: a& \! {2 M }5 U" s+ o& O, Q. M
} T @# Z# Y9 p2 G, ]" s: \& J: S
" @. R( P2 ~/ A$ \
结果是:
S% J) G9 g' o$ [% Q8 @, r& Hresult is 21 z( K' R6 G; S( f4 d" f
#
) t! d9 T6 O+ u/ E+ I4 M2 C# An unexpected error has been detected by Java Runtime Environment:
& `% s+ L3 P( @, C* [/ S6 x$ N7 \) q## c' v& R9 x' u4 V& ^7 z
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068, ~6 s9 p3 N% n1 {8 R- ?. q2 l. l5 m
#
' \+ p% ?. o: y# @! t8 E# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)8 m. [1 C; C `0 |
# Problematic frame:
. p# p+ m2 Z `4 A# C [javaswarm.dll+0xb8305]3 g- P8 t& D1 \
#. d5 C- a4 f8 |8 t' |8 M
# An error report file with more information is saved as hs_err_pid1064.log |