我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。$ L7 J; O5 x; K- y7 j; `
import swarm.Globals;0 C3 ]" M9 f' {7 x7 A B( b
0 G9 f1 x; D. m5 ^# _; }0 D4 fpublic class test {
- u( I& u/ `# V /**
$ G) N# C# p9 {3 Y8 y/ H * @param args1 U! L F6 k2 ~6 _1 M: z
*/
( H1 @2 W$ H5 v( ^ M1 o public static void main(String[] args) {/ v' o# v# C _ {$ U9 P( ~, I
3 T1 U% G& m3 j' T& Z
int y=(int)(10*Math.random());. j: O! J6 C! w! R' d
System.out.println("result is "+y);) t; O; E* L/ Q' Z1 x! w6 p
1 x% v: c9 F* R- ]5 M! S double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
( @( f& U& j# H: p1 i: J& b* A System.out.print(z+" re");' \2 J( n5 A T5 S) Y/ H# A
}8 p6 L. x: s0 r8 D, U
}
$ Y; I2 b& k, ?1 f8 g( Q
0 C; H% D# }2 ? n5 f结果是:
; Q0 R6 Z$ X- K5 C2 @result is 2% q# V: v5 U5 H) ?
#; f) \; O" p( Y7 B H4 ^& s* [
# An unexpected error has been detected by Java Runtime Environment:
. Y" T( L: [; V7 Q Y% E#
% k/ A$ o3 y3 j: T! v1 x/ f/ x# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
, T5 Z4 r5 P+ S2 B; U4 C; i( E#
) D! ~$ T! r7 r0 j# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing), `3 i M0 R# p8 r
# Problematic frame:8 ?- u3 e( T, H9 y4 s" V3 f0 m5 A& B
# C [javaswarm.dll+0xb8305]
2 @- e, b9 h2 h% d#
0 ~! M7 g2 p* ~$ X; U5 ]. e. g# An error report file with more information is saved as hs_err_pid1064.log |