我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
; _( {% ~+ A! h! J. mimport swarm.Globals;
: Z+ @) c& H% J
: { A( M: \3 Zpublic class test {
5 f& b' u$ M/ l) g. M. b4 U# M /**2 r0 f6 P' N X z# U
* @param args4 S9 n7 v7 @ z& W: }2 {
*/
" u. T7 ]5 ~8 v9 N1 F: o+ F public static void main(String[] args) {
3 f, C9 @& x. i0 } 8 \" B! U, |/ f( @0 W/ N$ o
int y=(int)(10*Math.random()); C9 E; l& J; Z- G7 b6 O" T
System.out.println("result is "+y);
7 M9 e, Z0 n$ q$ |
% E( Z/ f* u; r double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
9 L( P2 c& R% D$ r- j/ Y0 v2 l System.out.print(z+" re");
0 a$ {1 G) F! q- R6 w# i }
0 F- d: Q4 l0 O @- v2 Y}# b% i2 e: ]( J( q/ h
e8 h( o* T" s+ e/ c9 s结果是:
: a+ X' s1 n/ p' I5 Iresult is 2
' @2 ]; O" h0 E4 D#
, |! [ E$ e8 f: E. K* W5 q4 k# An unexpected error has been detected by Java Runtime Environment:. V1 D! I; ^3 B5 k5 S: W5 ?- ^
#- N1 c2 O- t# M/ ^$ E: Y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068: H3 z8 h* W/ h6 @, G
#
/ q6 H- J2 k/ U# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)/ K) n# u( h. K3 P8 I5 m
# Problematic frame:" F+ }1 g, U0 m f, i+ d1 |
# C [javaswarm.dll+0xb8305]* y( t: i2 M, h9 O( [2 {5 c$ |
#
, g8 p9 t& H$ p d$ E: D& E# An error report file with more information is saved as hs_err_pid1064.log |