我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。2 I6 w3 b6 ^% i, Q* h6 l0 M
import swarm.Globals;7 h$ ~) G$ m5 W0 j. g8 Q4 K* P
# M$ f1 Q, T% P# Y* y& n) u2 h+ p$ G+ Npublic class test {
% U: @9 u- U/ j* R$ s /**9 }! u: ?/ C9 \
* @param args
6 o2 g9 Q5 v5 Q9 s4 t! r2 G7 \* @0 r */
) b& s" p$ i% i public static void main(String[] args) {
; ~& u* X9 ^ O. b) h; S3 ^ % Z+ Y4 _, K- { T
int y=(int)(10*Math.random());; K1 Q% ], s4 t Z. p$ G
System.out.println("result is "+y);
0 z* s; g7 I: R, c& Z
; U9 Y' B- U1 N double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
' x; h! R F$ ~- @' j System.out.print(z+" re");
( v7 C6 r7 G. l; e& Y. d }
7 j+ Y' n* O" I8 r! }5 V}9 n; i2 E( z: q! p
9 V# F! I8 ]/ d/ Z# c$ g% t
结果是:
: I5 i) l0 ]+ g0 n* Eresult is 2
J v! y8 G7 g5 O+ _8 Y' d. \3 S#
/ n! r' k4 l9 S. Q# G. x. P& d6 p# An unexpected error has been detected by Java Runtime Environment:; m' G; E7 @+ ^) j- [
#+ @3 y" M" \ d5 j6 u H1 m" L, n
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10686 U+ P$ w% i* H& o
#
6 y- c; J' M9 B* ~, w# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
$ h1 P7 S( J' x8 V6 J9 \- O, O7 H# Problematic frame:
( l. n! B) i& r0 A4 M9 ^* c# C [javaswarm.dll+0xb8305]
; j; N6 h* {4 i$ e! C7 T3 \#/ p( w+ _& Q9 {" K }0 E9 U
# An error report file with more information is saved as hs_err_pid1064.log |