我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。& |5 ^! u% j" J0 a( c
import swarm.Globals;
* V5 p3 s7 I* _" @& @1 c6 b, V8 X
, B2 V' o6 B7 ~8 @) s: H$ {9 ?public class test {
% b6 O, L% r) C( _6 U /**
* J( P6 P8 m& F" i * @param args
* X1 a5 M& q" O6 a- @$ Y1 M% h/ Q */! u" w$ ]" m6 b; J" o& `
public static void main(String[] args) {$ B- M% S4 ]6 p' D; L
3 i6 H) p2 n9 Z
int y=(int)(10*Math.random());: {& F5 d( A1 r1 \$ ]
System.out.println("result is "+y);
+ `# X! y( H4 Q1 r7 f# T" i v8 e
! S8 Y% m& Z# m3 r double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
- H1 F$ U; o( @/ A System.out.print(z+" re");4 i! j# f0 v4 E) f( L+ Y/ Y% @8 {
}
* e4 E0 M- a) }. r# u}& \' L& Z# s: |4 @4 {& e( W' }
! }, M$ ~( G" ]* D5 s. H# k
结果是:4 V7 \ E% \3 Z. @& Q
result is 2$ U# J1 [) ~* ~/ t" r; H
#
( c1 D' z6 m% ?% @; l* d# An unexpected error has been detected by Java Runtime Environment:
& s# Y! G* N' |1 P! k" q) t4 J#' M1 e& e! ^4 a2 j9 @$ E
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! w+ l( f3 R1 v. H% d0 F6 l
#) \6 E/ N/ z0 g$ T3 ~/ ~4 B# ^* W# w* A
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
+ |) n; b% W( i# Problematic frame:# I3 Q: c* w8 }" Y, z
# C [javaswarm.dll+0xb8305]
' V4 J5 s! E! F#
u5 r( Y8 r U% A7 H/ L+ Z) {9 {: E9 q6 x4 P# An error report file with more information is saved as hs_err_pid1064.log |