我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
( S8 c" p4 d4 V2 q6 w |* Gimport swarm.Globals;
) E, ], a0 R. W0 j% Z9 q A. b- Y5 x E) V7 N1 f+ }
public class test {
; [6 g3 B _% w/ y* D /**: P9 _. r$ T d; x2 E
* @param args
8 v9 U6 Q* `2 H */* O& w f; G u; N( B8 r |0 P
public static void main(String[] args) {8 l1 P, m! z% \
2 n0 X. W7 d! b4 c" P
int y=(int)(10*Math.random());& g/ K3 u0 ^, E
System.out.println("result is "+y);2 E% r- }% }- L
0 L8 T3 K, k: Y, Y/ G
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);0 A9 Z7 \2 @9 o: d& f$ d+ ?
System.out.print(z+" re");/ f/ w& C3 @5 J; X( i2 }
}
0 w9 D8 i6 S3 _/ m$ g0 C7 X}
0 ^+ ]6 j0 F7 H+ v; K- v9 A* O. f7 r
' s5 _! i" V! o3 C6 M7 p: X结果是:( s* r1 d; E! f& `0 c/ J$ k, w4 o" V
result is 2% b1 I: N- F; R" G! {. U( g1 h
#
/ s. a3 U" I3 A4 K0 U7 r" T$ s# An unexpected error has been detected by Java Runtime Environment:
+ ^" {2 q9 l( P, `1 s#" {7 {! x5 s' [4 N \. N
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068" h( N( k0 X/ y6 ?. i$ }* O
#
, c% `1 [$ V/ b0 r( ~# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( o+ o1 D% y2 Y. U/ q
# Problematic frame:3 K8 K2 z/ Q8 N9 d% `4 T, p3 `) `
# C [javaswarm.dll+0xb8305]
* \4 k5 b6 m( b! n9 K& A#( y" E# t3 G! L) L ~
# An error report file with more information is saved as hs_err_pid1064.log |