我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。3 i+ ^6 d. t' p6 V, f, M3 |
import swarm.Globals;+ R! I- o7 r1 E( w
2 L, x* n0 ?. N; G
public class test {. v; R1 C/ J' M; N" X% B( f* T) D
/**
+ K% q. I. T4 {! u: P * @param args9 I& u/ v/ j% F: T5 W% r& h) p
*/+ p6 @# O0 P/ f
public static void main(String[] args) {4 z/ a. m* I- i- [( b: L+ ]
. U. K. q8 g% |% F
int y=(int)(10*Math.random());( V2 }+ k7 C% T9 ~5 N( Y
System.out.println("result is "+y);5 `5 |- ^, {6 P% ~# p5 P
. d/ g7 u' U( ]" F7 N
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);# |' y5 @) R% _. v$ p, H
System.out.print(z+" re");
; G' l" Q# K# I" {! y } b6 ]* c- b9 O' j/ J. H4 V
}; _0 h, p6 j" q$ p0 o8 |/ `: c/ t
# n7 w- f, Y' c; {) y h结果是:! r3 n# Q1 e9 _
result is 2
- [4 V) u) P& \: v#
8 W# C3 w3 K6 F# An unexpected error has been detected by Java Runtime Environment:4 V/ q) l3 [9 L/ y, ^& m% ?" F& K
#
( ^( Q; r* u9 k8 t3 }# a7 N; r# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068 m6 @; w; ]& C+ Y) i
#
7 K! }( \4 r8 u% M$ f" l# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)3 h9 j2 X! f4 }/ u6 X1 u7 l) c0 F
# Problematic frame:
; H: j( o, J6 w5 F. T( S" S# C [javaswarm.dll+0xb8305]
9 E' ]4 b; ^5 [; [, S#& [: h6 i" c' m
# An error report file with more information is saved as hs_err_pid1064.log |