我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
b7 t+ b+ F. Kimport swarm.Globals;
/ r" Y7 R: M, J1 W& M3 B u% t3 c, R6 h* P
public class test {- F9 t3 x- t; u9 J: J3 N
/**
7 C$ ~2 ?( G2 P! o; S& ` * @param args
* p- v7 n6 c4 |, v9 r b */
u# @& R! @& d& p( O; U2 y public static void main(String[] args) {
- v$ ~- F" W& }, H
6 ] I3 l* V/ @. ]0 w# t3 L! g int y=(int)(10*Math.random());( p! E- u9 ?2 X; W
System.out.println("result is "+y);
% j) m4 U, ]. k P5 c
9 ^! e# W4 ^& C `, z double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);( z. G, _, p" S: l6 Q- ~
System.out.print(z+" re");
3 D9 |' ~% z% y* P% W5 ^- J }8 n e& s& l' {) `4 H5 c
}, T. m7 A2 }. c1 q) p- q! `
; ^2 D4 s4 f" l5 L结果是:* U0 E" L6 f8 u7 y* K4 A. c! k
result is 2
4 G! z2 d& S$ z; G' C4 a#
: y0 ^/ V. C( X. X% T1 I# An unexpected error has been detected by Java Runtime Environment:
4 w( a, K+ s) h! ^( _+ F#
# I3 B; R$ X9 z* J# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
. B/ c- n' M3 b#
4 Q/ K% L5 k3 r/ f3 Z8 `/ _. B9 a# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 J4 _6 N; [# E4 o5 t
# Problematic frame:
1 e/ n. M- h$ K! E# C [javaswarm.dll+0xb8305]6 s4 W; ^2 ?- @ }9 s
#! ^% \0 s' C0 f( u
# An error report file with more information is saved as hs_err_pid1064.log |