我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
& \8 I( Y' T1 [7 ]4 L- Q, N# l% t% _ Simport swarm.Globals;* }/ m% h' I* n4 n' C; u A5 j
0 o/ m% Y4 F% y! [8 o! N
public class test {0 P+ x Q; j$ r/ R+ j2 y( p6 G
/**( l6 a8 Q2 ~: i5 C* b, I: ~0 [' a7 i
* @param args) n, k ^9 u5 d. f# f: v5 C( j) d: N2 J
*/
% k; `4 k9 \) V, B, B+ _ public static void main(String[] args) {4 I$ g1 T4 k$ d% q! H1 J2 L! f
& m2 h* l) f) ~! m8 m z4 n- _
int y=(int)(10*Math.random());
6 P( e6 {: `) `' |7 b System.out.println("result is "+y);
; R5 P9 w D p. Q
2 W! \2 j! c5 N1 Z0 o# h# E double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
, m+ W$ c7 d; `. i M6 v1 D System.out.print(z+" re");" }6 c$ n3 x( r8 `7 g0 I' f3 C
}
9 k/ a0 p5 I2 J0 [}
# t" t+ ?: A, e2 W+ i1 x" `6 Q, c' |# S- ~. k
结果是:7 y* ]! w7 G4 ^' [
result is 2% `) V2 T: `; m
#
8 f- j% W8 P/ {3 Q: Q# An unexpected error has been detected by Java Runtime Environment:: d' P1 @) R3 B0 m
#
7 v5 s3 W2 Q2 H5 h8 m& J- l8 k# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
+ m' p9 x9 d- m9 n#
( O; Y1 ? _. t( h# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)1 }0 o8 d3 `( e# b! @$ M! b6 n2 R
# Problematic frame:
, G& u2 r$ X; z( N, _; x }8 Z# C [javaswarm.dll+0xb8305]
! g( `* I* }8 A#
. k' s0 z2 w1 |' o5 w+ i# An error report file with more information is saved as hs_err_pid1064.log |