我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
5 |) e! s& n: @% cimport swarm.Globals;- g$ I! x( ]5 q0 I, p0 P; v
$ ^& G) x6 S8 q' ?. vpublic class test {
+ [3 N2 K8 A. I, N6 {0 u. f' S) u' N /**
6 A* R+ N7 E9 P3 M2 P * @param args
3 x5 W- Q0 V7 w3 _1 u */
% o8 P3 |; O. p4 J8 A public static void main(String[] args) {/ o; W. B/ Y' ?1 @' ?, W
* ^2 V3 O8 W4 p int y=(int)(10*Math.random());1 y2 }* w& G; i3 @/ a' g1 g+ |
System.out.println("result is "+y);
1 p B$ Y/ P6 P: Y9 K$ n
( r; u. E: @$ t double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 j/ |0 O8 T" h- |- s |1 F
System.out.print(z+" re");) s h3 M, s% v
}
1 U$ k# T( W8 \9 }}7 T" `: l5 q- ~5 {! p7 V
1 G3 [- r( h. O" q结果是:
I' `7 G/ q4 Q' sresult is 2
* V5 A- [0 a6 c6 C#
+ Q6 l3 {! t4 w, W( i( i7 ^# An unexpected error has been detected by Java Runtime Environment:! F G- J5 W+ D- b" n# ]* Z
## T" W: T/ n4 J/ \1 K- g
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10688 E. J- l! g; a! `* k
#
D# S8 n' c. j/ ]& _# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
. R8 o" [" F/ ]1 ]7 o( c# Problematic frame:- H- H1 o* j% Q0 \6 f
# C [javaswarm.dll+0xb8305]
. [5 \! M% U0 T5 k6 ?6 o, a5 J#
; j8 r: c) @* j& {# An error report file with more information is saved as hs_err_pid1064.log |