我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
3 q! h! D' P. E' Wimport swarm.Globals;
& n% i9 U4 _6 X' w/ D* ~
/ n( Z& J" v4 D% Dpublic class test {1 [: o1 R3 [( l& y8 M4 l; l
/*** x6 r. m8 V) x
* @param args' [% D% V1 z5 B8 I4 e. p
*/! c' W( ?& z* y V( N. O' a
public static void main(String[] args) {
* Z8 S1 h! b# x* K* B
& B- |" ]% R% r: G" @2 ` int y=(int)(10*Math.random());* P- D3 T4 ~' H2 l
System.out.println("result is "+y);
% k" I: }& j: A$ J q `* v: `
" _% b" d$ Y9 V double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 A6 f, X4 F- x F2 t. c
System.out.print(z+" re");
[- U( r% M* i% G" O }6 w9 z0 t( q1 m8 j: P" u
}
# _/ U6 o* K& S4 X5 [4 R
1 \: x$ `/ M. r7 T结果是:4 B: X! l1 x9 g2 Y
result is 2
( Z1 o) c* f4 Y H+ |+ g#
" P9 s1 S q( }4 e+ P# An unexpected error has been detected by Java Runtime Environment:+ k' Q4 v- ^/ l+ i, S
#) W" R- j3 t% `, D3 ]
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10689 C9 ^+ L% ]- |
#4 P% t( ~2 k1 U, B4 }; \ }# E+ L2 Z/ z
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)# |% y) S# }& `- K
# Problematic frame:
: A' Y9 Q: W. h" k/ q* g! V9 @$ b# C [javaswarm.dll+0xb8305], o7 t8 Q: c+ f8 r# K, }& _& ]
#& P& {2 v0 R+ Q8 l, e" |* u5 J
# An error report file with more information is saved as hs_err_pid1064.log |