我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。) E( x' C- k' _, k6 @
import swarm.Globals;
! k" d8 C! [) w4 m: p9 h( f
b( e" g, V8 [7 c6 N% apublic class test {
( i" m- C$ A/ Q4 u' p, M0 { /**
& y+ A# c9 C! I5 D- C% ~ * @param args. D9 T! {# q3 k1 M+ R6 e1 {
*/ t& k4 p! @4 W) N& E; x) R1 W
public static void main(String[] args) {- E- A3 [# Z/ R t/ j/ d* C
% A1 [ y, ~6 O0 R( K; U* C int y=(int)(10*Math.random());4 s/ T3 O: q! \" j
System.out.println("result is "+y);9 f$ c5 U8 H+ e2 t! [
* n5 d. \0 o3 K, u8 d; K# i1 V* r1 ^# z double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 O: o, `2 @# W* `- `4 A3 M4 j/ w
System.out.print(z+" re");6 o# J3 d) a3 L! A a9 N* t
}
3 W2 F0 z! ]$ a1 d' [; j}
9 `* V8 o8 B2 U2 x7 n
. V m3 f' O" K结果是:
; R) m! i0 e5 A) [" Y2 Kresult is 2
5 j# S ~/ I) |* t#
; O) @6 D+ V1 ?3 _# An unexpected error has been detected by Java Runtime Environment:9 w) G2 L2 W2 Y, ?2 J+ v1 g
#
" N8 k. T* A. g4 B8 ]4 W# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! N) ?7 G3 k! k; F
#
9 C3 K; P! G# D7 p# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
& ?0 L$ F' n7 m! }# Problematic frame:5 o$ J- _8 K2 ^4 K+ z, h3 n/ \( |
# C [javaswarm.dll+0xb8305]
- q5 O' M+ o" _- k+ r#
6 w. G; N/ @% N3 R$ U i% b& D& `9 H# An error report file with more information is saved as hs_err_pid1064.log |