我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
" f* }9 F! a/ eimport swarm.Globals;
6 Q0 Q$ T$ S$ `, g; X1 d9 f3 s! q+ {$ ~! v% |8 E( Q# _# H7 v
public class test {
7 j8 L2 [' g5 D2 N K# v. H" w. q /**8 W, L1 _! @( ^4 p, b
* @param args
' R0 z H+ g/ Y9 j, P* z */. D; V a d# L. A# n0 t8 e( @
public static void main(String[] args) {6 c* c5 f8 w+ ]) h6 _' w! e/ E
2 D4 r- ?1 I0 } B
int y=(int)(10*Math.random());0 ~+ B3 J8 F# Q* {7 O
System.out.println("result is "+y); J+ ^/ s# e& @* {5 ]
7 \$ U& |: b1 s! S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
( m" A* N# L) r System.out.print(z+" re");
" n" P ^, @ m }
" h" U5 J2 P1 D0 ~* ]. R}# l5 @0 \8 R$ q# p4 m: [
! f3 `( }0 y, Y f" m, V
结果是:1 p3 @8 l% W) ?) \9 S4 Y
result is 22 Y& h& \2 X: \5 h [1 a- i
#, S/ r e& ~! B F7 f) _
# An unexpected error has been detected by Java Runtime Environment:0 t8 O& |$ F3 c- z- n' x# Z ~" R" s8 L
#
; V2 U' e8 `0 Q) @% G0 S. p# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10689 b# ?8 y5 M$ n
#
/ ^5 q( e$ ]4 \7 r: y# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
1 f. c {, e5 L# Problematic frame:
- i6 K7 A( C$ B: D6 t# C [javaswarm.dll+0xb8305]
2 j' ~' S3 T7 N# |: G3 R#
9 s. ` e* x6 W( ^# An error report file with more information is saved as hs_err_pid1064.log |