我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% {& R* ?" L Z. Y3 r* F% timport swarm.Globals;- G5 ^% X6 Y N/ b- f8 T' j+ b2 J* S
1 ]; ], z# i+ \# R) f: @public class test {
+ L; S. w/ {4 e3 ~' O /**
" c u4 s* E, x4 p; Q- z. V% K * @param args5 Q- D, @! o( t% ?, [' W/ K4 O
*/* v% N2 j6 Z, s' z
public static void main(String[] args) {
9 j+ ]+ a' k. N$ v
- X" q: m& c6 {4 C, B; x int y=(int)(10*Math.random());: J0 N) m$ p( B1 s2 i2 A
System.out.println("result is "+y);
+ Y! n. i% u8 H P1 l" ^2 M* I# T1 Y1 C; z. R3 R
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
9 |; `( o( i5 m3 A. t System.out.print(z+" re");
1 J$ B0 ~5 D! u" ?6 i9 J& b7 x" P }
% c7 O) f. f" Q- c8 F}3 F9 h6 ]/ ^/ a. @0 n7 Z: F
) ]2 C# \0 s* `9 C结果是:
/ M1 R: {6 b2 Cresult is 2
8 S! _3 y2 d6 r9 o#
, ^7 w# Q% ^0 [% B Z# An unexpected error has been detected by Java Runtime Environment:
2 ]- h7 a! ~! i2 F9 g#
( V, n. a# j3 }: @* p @# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
/ t$ P" M# f4 W) B2 l% S7 Y#! K9 O9 ?5 h/ s$ s$ n
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ N& q% ^: o9 X3 q g6 `# Problematic frame:
+ H" d: z3 G5 @$ W/ F# C [javaswarm.dll+0xb8305]
! ~9 R, B3 L9 s#
' B3 Y' G, G& R0 f' }5 R6 Q# An error report file with more information is saved as hs_err_pid1064.log |