我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。1 y' }( E. O6 V# M7 ~/ s& A
import swarm.Globals;6 r9 ? X0 j! Z5 C& n9 r) C
7 l- m; R7 G" m7 T; N3 v# |public class test {
' A+ P8 R! b. B0 p /**) Z D( X9 e, T7 d# U/ Z
* @param args
1 o$ g8 F" K$ p0 c5 Z6 M: a; J */
, l7 R; J1 A1 {+ d0 |: ]1 p public static void main(String[] args) {1 C! A# K) r7 D# ?0 v/ l- Z
( f+ Y2 ^/ \/ \% M5 h
int y=(int)(10*Math.random());
G3 U5 B2 b- P System.out.println("result is "+y);
0 [) D/ ~7 C& w) v& r+ ^, T
3 W! {# u5 C* s: [0 A: D4 y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
9 q% v# p! ]# @) n" b; V- T' i V+ v) A System.out.print(z+" re");5 c' S# ~" A, E! f& x; ]
}9 M* M9 E6 P- g7 u
}
4 a) `! a& O9 j0 H2 {2 [, e% A- U, N4 b3 n ]9 d0 G {
结果是:# g" @6 c. y( k" C7 [3 ^; i
result is 2
1 g M' B0 @3 n3 a$ v; I& r0 k( E#
3 }# X8 C7 |5 e1 |) i+ X# An unexpected error has been detected by Java Runtime Environment:
! N6 W+ C/ T( k5 y& I$ O#( m9 |& i- E6 s+ ~9 i. {
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* g1 O# C/ x& i- W P. `
#9 B! [7 g' P1 O2 }, g5 o0 B0 Y7 n' ~& a
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
5 O7 I4 n- D% W2 ^# Problematic frame:0 Y% ]; t# Q- K9 W( b. Z+ e
# C [javaswarm.dll+0xb8305]
+ j' c8 j8 [2 b) {) U* e( O8 }#
4 g. V$ A" l$ M7 E# An error report file with more information is saved as hs_err_pid1064.log |