我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% m$ R% Z) `* T7 I; f+ E4 A5 w* ^import swarm.Globals;
- ?- `" f. H- @* i6 V; L/ U$ q% ?* u W$ l& \
public class test {. q1 Y% H8 K, s4 b0 y
/**
: `3 g( Y; v- H4 O. J% N. y2 x8 V * @param args# `+ {; |( I/ V% s
*/; s: f' N* e( b/ Z
public static void main(String[] args) {
1 ], k3 q2 @/ h# |" e7 @
0 u @+ O6 N. M2 r int y=(int)(10*Math.random());
! k- Q! ] F# o! L, o% p9 l& o System.out.println("result is "+y);
; w, B# z' p+ x# k
; \4 R. {# _$ u# \ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
7 ]8 s* t; j& l2 b5 T/ w System.out.print(z+" re");9 N: V4 e8 w% L5 ^3 t
}. _8 }( V: H; u) e
}
$ B; l1 ~' C! F$ h0 B! p5 U! J" L' Z4 N
结果是:
; m5 l3 N ^) Cresult is 2
8 H2 B% r' Z5 h1 `! O#3 Q3 m: E4 _+ u V, c* q3 z, A
# An unexpected error has been detected by Java Runtime Environment:& {. T. a% u1 o) ]
#4 j8 k: D4 G. }# A$ @" j& s/ b
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068% \7 N* L1 a% m
#. d- X& E7 C/ Z5 X+ l, @
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 H/ ^' m3 Y9 B$ @% [+ X
# Problematic frame:
$ i! _8 \5 B3 ^6 J' ^/ V# C [javaswarm.dll+0xb8305]
+ F$ e' [ V: Z7 R* P* c#
2 f# g) j/ A1 R' K# An error report file with more information is saved as hs_err_pid1064.log |