我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。- L# l% H$ q2 W6 y* l! o" {+ n z8 D9 e( h
import swarm.Globals;0 z# i: H3 x) Z; |( T& _* x3 E
7 j: l2 t- h) Q3 B( |5 h xpublic class test {1 T+ l! j! e! D" W" c" l% p
/**
! d2 n+ j) f3 `7 X9 | * @param args+ f _) o: q+ c- M0 }
*/
% V, @# F4 F K. |4 b public static void main(String[] args) {
$ @3 ?+ f) ] j! t/ |5 G8 I & r) g- k) V3 L; q4 G
int y=(int)(10*Math.random());) ~; T) q8 y# v2 Q6 @; G
System.out.println("result is "+y);3 }; q# L! u+ ?; J
/ N- O) I& h. K2 t5 c double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ h) n, W5 }9 u System.out.print(z+" re");
3 w$ i7 ~9 |* \8 @; @6 f9 h9 c }
1 Z6 `, ]% z' F$ s! v4 z+ ?6 L. g& Z}* `. B% [( ~7 d$ Z! y
8 H$ e5 k% L9 e! c- N结果是:
( X; k* ]4 r2 f& r- F5 F# B' Wresult is 2
/ E/ e1 b+ U8 \. k#
8 | p& M+ P* K, t& d9 C( k# An unexpected error has been detected by Java Runtime Environment:
8 E7 ^0 K. G0 z0 W5 S#
( r5 j. x; G: C/ t5 c) o# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
: `1 h8 e. |% B/ d" `- i#2 ?2 `( O- W# }4 E
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing) C2 ]+ t, H4 J) Q' Q
# Problematic frame:
9 w v% H4 _, I+ C% X, l# C [javaswarm.dll+0xb8305]
2 R+ l( ~! {7 Q3 T/ U% g* j#
+ U, Q( J# `9 q- C! b# An error report file with more information is saved as hs_err_pid1064.log |