我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 [2 [) ] A$ N& ]3 b, g/ E. himport swarm.Globals;7 \2 z* Y. y& q5 g
! m& H0 Q3 P" f8 P% n4 Y
public class test {1 w5 V* t- q1 A9 ^1 ~' L. b
/**
- Z. `5 x5 E9 Q/ e8 g, B * @param args$ a+ T, n* h; I# w) H8 @0 M, N
*/
0 n1 R+ @! w& K) f8 y public static void main(String[] args) {6 {* g! t6 Y) ?. d) t/ L" {/ G. `+ m
7 t) ~" D2 I% v. @9 M0 r# Z, R int y=(int)(10*Math.random());% A3 u; k0 f X0 E' _- k
System.out.println("result is "+y);
, D5 Y# U1 D' R: n! J
1 P3 @& j4 t% w double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ K/ y: k& y$ q4 o4 w0 m! r6 D6 S System.out.print(z+" re");( e8 X z: b( e* @
}
5 b4 o4 U- u# Z( B; I+ v}
& n' @; d2 I$ k7 M
( G4 v7 b6 |! J4 G5 O3 t结果是:! o- i8 s) W5 K/ L7 F
result is 2. i2 X: a- ]. F5 K
#5 t: R+ P$ z# J
# An unexpected error has been detected by Java Runtime Environment:. ^( r$ r4 K4 F7 g& q+ } P
#7 l+ q7 A% ^; t
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10687 \2 O& j. r# ^/ r6 d2 h( }
#
# ^- z$ B6 K- g3 T4 k: r; e+ S# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)+ U' c8 w6 |, `" s
# Problematic frame:9 W9 W I: n9 n, e
# C [javaswarm.dll+0xb8305]
6 x% W) a' `5 h+ `. V! H#
y2 I9 a. Z# @# An error report file with more information is saved as hs_err_pid1064.log |