我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! o1 w! E. s2 y o/ Iimport swarm.Globals;
! k1 v7 O) f( A
7 o" o$ q6 X3 Z5 _public class test {; V( b7 @* e3 n# A' h- ?, B$ `
/**
6 \8 E# o; z4 {# ?) P% \ * @param args3 W# b5 S" {6 _2 P
*/, p; s$ F( M4 O/ o; G3 t$ @
public static void main(String[] args) {
* G3 P. y2 R7 p8 r8 E$ j 5 g9 B9 a) M+ F. f& S: P
int y=(int)(10*Math.random());
# P2 E2 w- e m System.out.println("result is "+y);0 U! B% X$ ?# C: |% e
6 t0 ~, n v6 z" L
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
" }- D; v! I8 r: i# P System.out.print(z+" re");7 Q; K- ] P7 k8 l3 J: V& h$ m& L3 N
}
6 n1 S' N5 z& S; I/ D% k6 w% _}
, H" |! V) v- T& \. @+ V. u4 V5 \" N, A
. b6 F- }* R# w结果是:7 M0 I( S1 d) z0 b
result is 2& ?( Y! k# T3 E6 {7 _
#8 _: V+ \: ^6 [1 w8 W5 x
# An unexpected error has been detected by Java Runtime Environment:) O# N; z/ X# w+ K
#0 F; M6 V0 S. [. `1 E
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 F2 t/ f! y$ z9 U1 l
#
% }, @0 \$ y6 p* J2 O# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
% r1 h; C( A9 a: w$ ^# Problematic frame:" P U& e5 G& X! Y( v
# C [javaswarm.dll+0xb8305]
7 C* m& Z4 D/ ~#
G- F* K: W9 H' L# An error report file with more information is saved as hs_err_pid1064.log |