我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
0 L" z0 A) ?8 q, C( w4 r6 f Himport swarm.Globals;
; K, h w) Y8 E: i' S, ? W. Y
) o$ X O( \: ^ N ypublic class test {
% O$ ~9 u, k2 m$ E /**
0 C# t$ }+ F5 p0 j; ]( p * @param args x+ s9 q( n0 F0 \4 H) h
*/- Q5 i- P2 c$ y3 S3 d. s2 f
public static void main(String[] args) {
5 c4 ^* p. ?+ D! N ' |9 W' r; k: Q0 T
int y=(int)(10*Math.random());& Q& R* ?0 a2 e- W( m/ X
System.out.println("result is "+y);/ Z' @: o- P0 U; ^+ y
* g; _( F, w3 v, w; D0 j
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
" F9 a \ @- J4 L, F O6 w+ q6 ` System.out.print(z+" re");
5 ~' h) ]# h5 B* I/ X' ~% z }1 S& I7 @( E) `; E
}
. d. k# n. e1 A
1 J9 y( g7 E* `6 V结果是:8 |9 n, J0 R- z" P- E' C N
result is 2# q' b# k3 b5 Z! G# _) B& Z7 ~
#
1 S, `/ n+ y, |9 [( L H$ }% s9 L# An unexpected error has been detected by Java Runtime Environment:
- t. [% }1 w- \3 Y* s# w#3 N1 A. h$ B! Y. g2 Q% |2 M
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 p+ l* Q$ H% L7 a/ O#; J0 q1 [# b5 `: ~% t+ D
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 a& f5 K5 ]1 z2 [# V# P
# Problematic frame:# ^) ]' `0 L7 z( r$ A
# C [javaswarm.dll+0xb8305]
: k& h& T4 k: O## b# q- B8 ]% j! e' m, a
# An error report file with more information is saved as hs_err_pid1064.log |