我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
; s/ E( P9 w: _7 Y, t& eimport swarm.Globals;
; D2 G: r7 l8 w5 \+ `; R8 t7 @/ @+ y
public class test {
; R6 ^* R& \+ w8 v: f /**, f o. l5 \7 Q
* @param args
4 r$ @8 _8 A/ L: j, | */7 n, C2 h. l! d
public static void main(String[] args) {
6 N+ |8 ~6 `" p4 `% _. f8 O 4 B# @- K. P4 A% R$ B, V* p4 \
int y=(int)(10*Math.random());
. Z+ X. ^# n K( a8 m4 ?$ X6 Z System.out.println("result is "+y);
' M! j0 ?5 x; M8 \- _ ~+ e }7 B+ o& u G# c% _
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);% M$ H% Z! n6 B4 f
System.out.print(z+" re");
% M% h7 I2 P6 G2 P B& v }3 F* }& ~. X8 ~" u- E) o- @7 N
}
7 E! a9 Z0 O9 I2 ?
% s# J4 G: }* i9 C. P结果是:
. S- w9 d0 L5 c! u" D, Y& e' dresult is 2
3 @; \ ] G' n- y4 g2 n#) q' ?, p: m, }3 o. a
# An unexpected error has been detected by Java Runtime Environment:6 q2 j4 t$ k4 M9 L9 i8 E
#3 T+ b* q! \( ]8 M" E
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* W. u& m4 q" s( x E1 G
#
- Z C# Z3 A7 A X5 S# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing). W7 B6 B$ b2 _$ H" `
# Problematic frame:$ V. B, b5 v! ~
# C [javaswarm.dll+0xb8305]' N) N9 `. l8 s4 }& ]1 c: V7 U
#
6 `+ h* W& B2 J# An error report file with more information is saved as hs_err_pid1064.log |