我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
/ r7 ~ \. Y8 T* J' b, g% ]import swarm.Globals;
y$ `8 m, i; p* N" O8 O4 ^! L7 a* W8 {. c. U; U6 j
public class test {; w5 ~* \8 l- t6 @1 ^: M
/**
; S7 v* o6 D* E' G9 M9 p4 P& `! C * @param args# Z: o; Y* H: n4 y; n
*/, G" {1 t _2 D! O1 J: d
public static void main(String[] args) {9 d% J& s% |, Z: a# P2 Z! ~
* ~5 Y% W. R/ W7 m' l int y=(int)(10*Math.random());
" V5 S" y% p/ \6 Y( v" G, _ System.out.println("result is "+y);
. H. H7 P6 B1 T( a, C: J2 I
9 V$ {; ]' N/ e$ T4 x" G double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
7 _; V" ~ Z; r/ S8 l: T' E' ? System.out.print(z+" re");1 U3 P+ o0 G* o( Y' y
}5 a( o( K9 g5 m/ l. y
}: [. W' s: K1 B1 y! T2 z
6 d; g3 G+ P1 i0 Z结果是:
3 T6 H0 e. t6 X) i( A5 V) nresult is 2) M4 B' e/ q( f' S
#
6 @5 F, ~5 [- z8 o) u# An unexpected error has been detected by Java Runtime Environment:
/ ~1 d. ]0 P8 f6 {. R#/ T& R5 Q# V+ F5 f' u& F
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068& v/ C0 g; p# f9 H
#
f( \* t7 M* Q8 p. | d5 g# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)) ~: @- L% l3 C. e f3 e, s
# Problematic frame:# Z7 w9 R! w/ V8 Y% f$ l
# C [javaswarm.dll+0xb8305]2 D7 R% t' Q; N+ P
#- }8 j2 [4 q" O M3 @
# An error report file with more information is saved as hs_err_pid1064.log |