我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
- n* B* i# w6 ?" a. Wimport swarm.Globals;+ A j R- z3 U- H
; m. T2 a* V6 j# `' Q# m
public class test {' C3 a' P( e. K5 k: X$ `/ Y5 i0 Z8 K/ F
/**
& D) B; e; o" I * @param args
- _: V0 `7 Z" x) z% b */9 q! j3 R! |% H0 H
public static void main(String[] args) {5 |( G, k! k4 O" Q% e
j: ]5 f$ p+ ]) l' w. h; F* y
int y=(int)(10*Math.random());% V. Y% u9 F7 h, x' T& O6 q
System.out.println("result is "+y);) N- @, E5 ^% H% F3 R
0 V' J$ X2 f" r) l8 j3 C: d
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ g; d; f& z& T8 |; {- m5 m! c
System.out.print(z+" re");
; K5 A" U r" w- p }
4 U6 [& X' f/ _& x p}2 a% [8 M p2 x, G9 G, {& p3 j# `( ]
4 [) a$ w- C/ i8 P0 j3 P结果是:, v8 W, ^% k. m# _/ v
result is 26 V3 C' J) R; U* \; {4 ?+ t2 E; Q
#
8 }2 p5 W8 U# }6 p# An unexpected error has been detected by Java Runtime Environment:
6 E: X! K( t+ a- R' C# s#
1 ^+ t. d7 e) Z# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10683 ]4 Z0 X M( K; M! `! g8 ?0 f2 n
#
: R' f% Q, p( r: S8 n" \# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
3 n, t* V2 |# Y, y" I( S# Problematic frame:; H& c7 Y& C' R; S; j: q. B
# C [javaswarm.dll+0xb8305]
( E5 ~6 X+ z: A$ o& _#5 S1 q3 t7 I$ L0 w9 L9 ^
# An error report file with more information is saved as hs_err_pid1064.log |