我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! M* ?( }2 D5 u! ]import swarm.Globals;- |2 P/ y, c: L
2 M( w" ?! y. ?public class test {* o8 r/ L1 w2 z" w
/**2 f! M+ j9 v6 w4 J
* @param args
& b; }4 Z7 }/ q2 A% @3 Q" s6 ]( ^ */
; K4 Z. f7 b1 J$ r public static void main(String[] args) {
, e5 @, z1 d/ J5 c& f$ q
9 M; g3 S) _5 x) {- m int y=(int)(10*Math.random());
, z. w- @4 M6 [) {- X System.out.println("result is "+y);
8 @9 x- O5 \/ R6 g7 J; h) h: k- v( {0 u3 N7 T& v( D) e
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
7 _% B5 v) d3 z- d% F System.out.print(z+" re");0 `! E3 i- l2 S6 K7 ]( r9 i: L
}
0 c6 ]: V+ B+ A% c}: o( b. f0 E6 V
) R. S* ~ o7 e5 B6 H x/ x1 h- _
结果是:9 J, ?; s+ ^' N' @1 H$ b8 q
result is 2
/ B5 `6 ] x# t8 I6 N- ^#8 R5 U8 \5 C$ |
# An unexpected error has been detected by Java Runtime Environment:- v2 ^. c+ I0 ?' M* |
#
% p7 N V6 Z4 {: y6 x5 N. W# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
% Z( }! Q" O' F" m1 m( m2 L#
( D) Y0 n. y! P4 r/ U# h# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
7 @: X+ F( F9 p- e; r: X6 j% D: T# Problematic frame:
) W( l9 Y; J* s* b- }/ D9 Y# C [javaswarm.dll+0xb8305]. }$ w$ { c! C$ H
#
( C# k4 N! P$ w7 i. E* a! g# An error report file with more information is saved as hs_err_pid1064.log |