我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。5 e9 y7 }* R1 X1 D1 W4 g
import swarm.Globals;
0 ]: Y) v3 \. D4 u8 E+ L. _% o0 [8 L- H7 S
public class test {
3 N# S; s+ u: w) u /**
9 b! G ^5 |$ o6 U* @: S; S- I * @param args* k. Y& O& Q+ j: i
*/
3 E; N. P" H2 n' ^/ W public static void main(String[] args) {
8 O* u) s( H" a- [! ~' ? Y; U3 E# K( i, B
int y=(int)(10*Math.random());
7 t. r3 S# I! a1 _8 d; \ System.out.println("result is "+y);
: I9 {* G: p/ j6 R% u( G v' ?4 X; {1 u5 G4 Y7 H7 F, M
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);& Y9 V0 g0 W" Z3 ~
System.out.print(z+" re");
}$ ?: t/ E+ c6 F I7 y }
. g$ c4 b. r2 _+ L1 ~# n" c}4 v7 P! ^+ ]% b$ |9 _
8 }" H6 \4 \2 p: O8 _结果是:, N, Y, r* l4 A6 ~- I5 N
result is 2& H/ G& d2 K- k
#
- ?# E0 f: \* a$ y0 Q# An unexpected error has been detected by Java Runtime Environment:
6 h8 w$ J' C6 _9 C7 v#( u5 c. L! a) g" l s/ d
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
# ~+ d) q( Y' V2 t8 t& ~3 C% m#' `/ I6 T$ l" A: ?7 v4 {
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& E2 h" D, ]; m! t+ i: F2 C# Problematic frame:; v* }& h0 {$ j# P2 w5 L7 R
# C [javaswarm.dll+0xb8305]# X8 s% \, e' ?
#
( s7 U% S8 ?* f: X4 k0 E# An error report file with more information is saved as hs_err_pid1064.log |