我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。. ~' p' a$ n. R: F& Z* C( \
import swarm.Globals;+ q& E" T- c" j" G& ~
1 O* X7 p) F7 C: g' x1 V
public class test {' Y" p4 B' |) v4 V* w
/**
) n2 i/ @( X/ x/ }( B * @param args% ^, c4 _6 |% }- c" e$ T
*/+ [3 C5 q/ b: Q8 S4 ?9 }* U
public static void main(String[] args) {
2 ^, ` _3 ]7 U" W1 y
( ]8 y0 t+ X9 `+ v int y=(int)(10*Math.random());4 o! E: V' K- y
System.out.println("result is "+y);
, m' A. ?. |7 K7 F# ~
% X# \( l/ K& ^) p- p8 @ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);6 T* [4 K* M, A B, y1 g
System.out.print(z+" re");
0 y. J" e/ S, J }
, @1 N4 O6 t, d: f* y}
2 s2 s3 l6 K9 w' Y* C3 R E! y. C! |7 `" C+ A; ?# ]' a6 M, Z
结果是:5 J5 Z* x% m8 O$ Z" |7 P& V
result is 2
. g* V, ^: S* d% @#, e& r' b; V; g: K2 D3 E5 y
# An unexpected error has been detected by Java Runtime Environment:1 Y6 L2 s; ^! }" x0 l
#
4 M8 R8 u- C0 ?/ a# F# W- U. u# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10688 h! f8 f* p( I4 a$ o# W! D3 p
#
, y5 `0 e; B6 l6 ^' } f# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing), a' M+ B) B \ R0 \( e0 M
# Problematic frame:
8 `4 q6 X/ t9 v, j% V, b0 [# C [javaswarm.dll+0xb8305]+ n, G8 x+ U4 [8 |4 S7 r! s# z$ j
#
* ?' n) E5 }* }0 Y# An error report file with more information is saved as hs_err_pid1064.log |