我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。: F8 U0 Q" v3 F5 e1 X1 ?) _
import swarm.Globals;- [: q. P* b+ {# [! V1 X
/ O. i! O2 a0 b4 b3 E
public class test {9 G. |( e9 [, V
/**
7 R* i& W U& K5 W% A$ y * @param args
8 V$ t, j& F% C: i" c k" P# m */
b. f8 F! }* Y, Z: Y/ e public static void main(String[] args) {
5 G p' v2 T0 Y; ^# M) X7 K 9 ?) [- ]* S# O/ \
int y=(int)(10*Math.random());% I+ {4 |; i. T& d" ^" f
System.out.println("result is "+y);
( [; h/ M6 S& f- ]" L' Y) G7 U& j& r
- a: T, S2 p, w, ]0 M9 T5 Y8 Q double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
5 b5 U K; S& z, m& W1 Q' C System.out.print(z+" re");
, X! U4 q( l+ e Q* }! @ }
1 ]4 h# V2 w: B: P' ?}
$ a, c8 c7 i% {# Y( T. o$ l: x* R
4 P9 X1 [; o# J" [' {4 c H$ n+ C0 t结果是:
! G: w+ F" _8 B8 O: S0 ]result is 21 z+ l& D* t+ r
#! I; Y( P( H% s3 M
# An unexpected error has been detected by Java Runtime Environment:
4 F) K2 O3 e9 R3 @/ m% q#; O/ e9 y& T* J! X- e
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068- |0 I' V: u' f, i8 z" @
#! s0 c5 l9 t: Z; T$ z
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
8 x& R E8 i$ V) b6 m. |# Problematic frame:( L/ r8 @+ N% s: n
# C [javaswarm.dll+0xb8305]
3 Z+ y! s) n# _! b2 x- @9 B#' q0 u/ Z! p3 P
# An error report file with more information is saved as hs_err_pid1064.log |