我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ P( q% \0 W ^. ?import swarm.Globals;
/ C5 L, ^# {* s- f2 u& d8 X. b
* z: v- S1 L9 L3 npublic class test {9 \/ P4 \, V& f
/**
- T# F+ N/ Q m \! D$ B' W * @param args
0 G1 H# r" x v& }" J! X */
" d( K" ~! c' W7 g public static void main(String[] args) {
( r5 u6 N# U5 t4 q1 A. e! N% b 5 B% _5 L2 L' ~& h& s7 `) w
int y=(int)(10*Math.random());
& Y2 e" H5 F' W" m5 |' y System.out.println("result is "+y);, A- y7 a% `( i# ]+ w
* ]6 M& {# A; i! \: O* |7 R double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ F4 t8 K! R4 H+ u% q
System.out.print(z+" re");
6 _! B0 P& t0 u$ Z v" k2 S8 @+ s }
' K9 f# |6 w ?, T$ i& ~8 ^}
$ F7 \! B( Z0 e* A% D
$ Q: M% f( k1 [% _ J6 T结果是:: N4 Z; I8 y m
result is 2
, }: E4 a' ?) R0 Z8 t% c0 L8 d#
2 Z; L" Q6 ^! c! @$ `# An unexpected error has been detected by Java Runtime Environment:& w% o) a* l( f: X
#
" t7 p& L' Y# |" H$ n7 e# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 r3 i' b% o w
#
1 j# E v, w) g# T, B" Z# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)# `7 H" s) G" i- f# O) Q
# Problematic frame:' L4 h0 g0 s; W' R0 }/ O
# C [javaswarm.dll+0xb8305]
$ d% x, t; l$ x+ d2 L#1 @2 T9 L4 g& W5 K# E
# An error report file with more information is saved as hs_err_pid1064.log |