我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
" a# K4 a J* Z7 }4 Z" f8 @2 v. w4 ?import swarm.Globals;) d; U4 v+ Q' J* o5 @- ^9 [: B
0 f# T4 S: _3 F0 e8 T5 |public class test {. T" E4 Z/ q7 E8 ?. ~
/**
( O/ k& M$ B$ ?& ~) d) w7 h9 l* B/ ^' ~ * @param args" `9 C3 {7 `5 b# b2 d
*/$ x H6 M/ }0 h: D+ }
public static void main(String[] args) {
; _' t1 m' k5 `' z/ ? E1 `, ^
8 Q# o6 j% L. {, d' B# X+ i int y=(int)(10*Math.random());4 d, V8 }4 n* D; S7 S @; _* |
System.out.println("result is "+y);8 v5 i3 i' u2 w( w6 V. o6 _2 e
9 P2 _. c' [$ R9 }5 F% S) p/ L
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
. h, \4 U9 u& N4 f6 `0 Q1 d System.out.print(z+" re");
; Y' S, Q1 }9 V+ c( I0 B) D }' q: L+ ?' l3 p
}
- @0 K5 G+ h# a8 N( N0 }/ D
2 j$ X% Z, e, ^+ N2 P' B/ Y" a结果是:
6 X* g C5 d8 G5 Y% Y. jresult is 2
9 ]0 h4 [- N1 U7 u7 I/ ?#
" V0 \7 r7 y& r# x# [/ b3 A# An unexpected error has been detected by Java Runtime Environment:) [. v0 t" @+ Q6 p/ t4 x! {
#
S* ]: {7 V8 ^! Y% `# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068- ]+ a; u. f* L" X' T
#
! _$ }* H6 b4 a5 {- q* R# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
, N0 N) a f( ~# Problematic frame: K7 Q4 Y3 f4 y( W ?
# C [javaswarm.dll+0xb8305]
$ d* u8 c* a- \: c. g#* V+ m; n N: f0 \3 R
# An error report file with more information is saved as hs_err_pid1064.log |