我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。5 }1 ^( ~' V' {& H" m
import swarm.Globals;8 X7 o* T% J" V2 F
, O0 ^6 w1 C# o+ A. E( \
public class test {
1 Q0 m. \4 h3 {7 \ /**
6 j5 f! l8 K0 d' d$ G. G6 j * @param args
]4 H u+ ~3 |) ]* ` */. A( E% S' t9 G; J3 h1 ^9 Q8 X
public static void main(String[] args) {
8 z! r2 v- m. K9 H- J+ s, b3 i
5 L; a4 k. C# l int y=(int)(10*Math.random());
9 r+ }6 O/ {: _ B( e' P System.out.println("result is "+y);
3 y- l4 b7 R2 p6 [7 g: k* V9 [5 O3 @6 p
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);% p# l6 r$ M8 X- O; v, S9 ]: O! ]
System.out.print(z+" re");: Q5 g( D8 X$ Y8 R8 [0 E: I
}
8 E: B+ H) I: @! S3 Q n8 j}
6 m, h1 X: u; W9 d. y! b( B% X! d& q2 K& I+ j1 q6 C& R
结果是:7 K* X' i. f( `& T& N% D6 I
result is 2! S- P1 e& M/ Z
#; A( X7 t! I+ d0 a
# An unexpected error has been detected by Java Runtime Environment:
$ s. l' N$ U. Y$ V/ p! {#
9 g$ z9 g( d0 x- ^+ y4 T- o4 n# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068( q9 ?) y/ r l* d& z% i
#* F- z$ t0 u: n. J f) E
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( g; _% t- Z' q: o% c! O! X
# Problematic frame:
! v2 o5 ~: L( v! F6 D* P+ M: C# C [javaswarm.dll+0xb8305]5 v/ S! h2 `2 c) \5 m* M f0 L1 n
#% D6 L5 D, L$ |% q! O3 l
# An error report file with more information is saved as hs_err_pid1064.log |