我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。( m4 u; U6 z% u
import swarm.Globals;
/ ~9 n* q% ?; h/ u$ k. d F! M1 i: J9 h- \, x+ \
public class test {" w8 I' Z/ l" [2 ^: y, e! ~- x
/**' x# w z/ p' S! Q' ] N- h
* @param args. Y; C! A( G- O* b! O( N
*/
2 `! g2 u+ h, Z p! p public static void main(String[] args) {* l, {6 @+ @1 n D) t0 ^
1 }% ` Q1 n$ k8 K9 x* L6 t/ F* d int y=(int)(10*Math.random());! W W# v0 q+ q
System.out.println("result is "+y);
k/ e! s" T- ^+ L! {! Q& H- ]6 @5 @6 M
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);/ D2 k9 W+ r, K1 v3 K) u
System.out.print(z+" re");
7 P" f0 Z% I! O; E5 @$ C4 e }# `$ j/ C* s. Q8 g7 z
}4 @- g$ Q, F" N5 R) }* B
% D# I# j1 R% W0 ?* _结果是:$ U0 J3 u0 m# D/ u, V
result is 2
8 L# E! R, Q) g#, R9 m( w }- y M) z
# An unexpected error has been detected by Java Runtime Environment:
) R0 q+ P; a- I#. N( c( B" p6 _+ u& C- W
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068. J$ T. J" Y+ b8 f
#; U& U7 M( o8 J3 Y
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)9 A, `& j$ Q% W! H
# Problematic frame:; {( Q) S! s U6 X3 r( }3 E
# C [javaswarm.dll+0xb8305]/ _, _, f% V. _7 _& L
#
3 ]/ i7 A0 ^/ R# An error report file with more information is saved as hs_err_pid1064.log |