我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。7 Z8 W9 ]4 e% u- {
import swarm.Globals;/ c. s' m' o: M) _. E9 i) V
7 h& }) R* B: P# kpublic class test {/ B1 _6 c# N# S; Z
/**6 x1 F3 t2 s" V/ D: ^; a) y m% M
* @param args
2 W' Q2 p8 j. o, e */* W8 z- q: t7 [- _# ?; F
public static void main(String[] args) {
4 v/ A! B1 l1 @8 W7 S1 C) ?0 ]* J 8 o9 D+ n( r& i5 V% ~+ p, S
int y=(int)(10*Math.random());
. [( v* S [' G/ S System.out.println("result is "+y);
( ?1 X) s# Q6 d. u
1 A4 h" C# h$ G K* J double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
( T/ X; T1 s5 u System.out.print(z+" re");
/ _. O9 S( V5 ^3 @ }* N2 S5 B) k/ @& |
}
7 s$ S' y+ U+ k8 x. o7 W
0 r( {8 P' i5 D结果是:
* G0 z1 Z, A' ?3 Presult is 2$ b7 L) ^$ O2 }
#( C( u' a0 y3 q; E* x6 C
# An unexpected error has been detected by Java Runtime Environment:, S7 R; m4 \6 o* i( W
#& n# ?' ]5 C/ n( Y+ i9 ]' Q
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068, d6 i# B) O9 Z+ x' C2 {2 b
#5 B. b% J; T7 E' N
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)- p' L' ~/ u l- S
# Problematic frame:9 {! X @& }) s, o% a: Q
# C [javaswarm.dll+0xb8305]3 x- }5 s2 m5 [$ d, g' {
#
2 v% P" `# h( B# An error report file with more information is saved as hs_err_pid1064.log |