我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! F9 P/ D' t3 [3 k2 a+ R/ l1 M% nimport swarm.Globals;: w2 f) S! [& r j! g: a6 x
0 P4 i1 I; G# i! @1 I3 B. c3 jpublic class test {
1 u; r/ `) O) A# `* | /**
$ J: A3 J' N) Y6 X( } * @param args# J' K6 ?/ v! l; b5 f; z
*/7 O6 y* A( W4 w6 h) h# d6 W
public static void main(String[] args) {
- e5 ?' H8 l2 j+ j3 P5 O& H$ b
E, g* d" n1 a5 C8 m int y=(int)(10*Math.random());6 _+ O! t9 @- t0 I" g
System.out.println("result is "+y);
8 M7 e& b& o" E$ ?2 P' F: a
$ D% s( B C. c( i double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 \* m& V+ W- |3 Q
System.out.print(z+" re");
- d( X O8 x8 ?5 C* G) I3 @ }( v: r2 N( h5 B" ?
}' B, D& n$ Y( M2 ~
( \% k$ c6 V" y/ b5 r结果是:5 _* o# C- d8 c& n P
result is 2
/ m$ J+ V% Q$ _, [$ @, q" }#
. e9 B$ f. z' Z. _ w( e5 T# An unexpected error has been detected by Java Runtime Environment:9 }; s5 P) H* w4 N- U) X# f- q
#4 R+ ~( q7 i. x" X7 ~
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
0 N& O" _- ^/ u+ y5 S% q; p#
8 D: s. {) H% @4 V" m# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" M0 U) A3 Y% f" |5 B6 ?$ B# Problematic frame:7 k0 b$ q# G- n8 E/ O% c% [
# C [javaswarm.dll+0xb8305]
4 B2 L' \" Y4 _2 [5 P! \5 r0 b#
F! s! X" d9 m( f; Q1 _# An error report file with more information is saved as hs_err_pid1064.log |