我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
, i% Z! U1 e2 F# o9 simport swarm.Globals;8 U3 r2 b- [, @2 N' @7 m
3 e& V4 N2 U: D
public class test {8 o( @- P$ t, E {7 T; w0 M5 J; b4 d! m
/**
7 b! Y& ^, X( n" X" o * @param args' j4 S! f4 B+ N3 \ L6 q' E
*/
) _( p' ^: h# g' V' U% S public static void main(String[] args) {
5 Z5 f5 `. Z. k$ Q' v
( }# t8 Q* ?4 H5 z8 p5 [0 o int y=(int)(10*Math.random());# i% k, S5 C6 N, L3 ?
System.out.println("result is "+y);
9 z. v" ~& I/ D1 ^; }7 \0 C
; N1 C, A3 Z/ g9 t A double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);2 {; [8 W o% N: c" p2 y) w
System.out.print(z+" re");
! \# x: z+ O' i4 ~( m2 z }* q. b: ^5 m! F8 c
}! N. N9 B/ g! X8 u
' Z6 a- R8 D* S0 C
结果是:6 C! p& i2 A; e! ^6 V. f3 a c
result is 2. T) z" o9 ]5 n u9 W* {
# F0 D0 W6 y2 R+ m- X3 \# _8 G( U
# An unexpected error has been detected by Java Runtime Environment:
$ N8 p, E# |) |* b0 }#
0 r- {4 l [! q: W ?0 R# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068% z$ c" G' \ p
#4 Y. C4 U+ @" Z
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
0 T8 v5 C4 ~- g3 C# Problematic frame:9 U) K0 }8 }. l- H( C5 v0 `" m) y0 g
# C [javaswarm.dll+0xb8305]
" U8 `- x! u2 a/ @! x0 q#
8 f1 o/ n) \5 C f# An error report file with more information is saved as hs_err_pid1064.log |