我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
8 t' f- k" R$ U1 dimport swarm.Globals;$ M' f1 u d* ?
6 Y$ r4 t4 m9 ~2 g/ Jpublic class test {# {- b/ t/ e$ U9 ?9 Q9 b; o
/**
6 b" J6 B6 M* M! T$ g% ?5 Y * @param args& h3 n3 q2 ~" W2 i! w; q) z( R& u
*/0 c! O+ ?5 F Q4 `9 M) X9 x
public static void main(String[] args) {1 V* Y) I( @! z- ^0 j/ `7 x
$ ^/ P; c/ O/ i2 b) G$ _ int y=(int)(10*Math.random());# Z' S7 a2 A" L) c2 b
System.out.println("result is "+y);+ k) y) f& K# n1 p) e9 k
9 A* l' A. t: s
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
) ]2 ^* {9 V! v System.out.print(z+" re");4 q8 l$ |- [! {3 s g
}6 J v# F- D7 s! h
}& w* U& t; X; \# m; y
1 b5 ~( Y4 ]$ w& M& r7 L6 ?
结果是: ?0 j% g' d% Y8 w% t$ n
result is 2
/ ^7 U# k. t* I( w* a' @$ l& } ]- y j#$ M& {* n; Z% Z; e$ T1 H- i
# An unexpected error has been detected by Java Runtime Environment:. N6 d. q$ G2 D3 M, C6 ~) l
#/ I& M% ]2 D- b/ e0 D
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
4 c; S! | T8 G' W5 E#' X0 C& e( F" c' U# F6 Z; ^
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing): l1 a7 t3 v, q! T/ A8 O- J
# Problematic frame:$ k, w( C6 S; Q9 F. }* ?! a
# C [javaswarm.dll+0xb8305]( I# W* ]# u( C8 J1 u$ Y2 P g
#
: p: X( f; U0 i0 x5 Q2 I/ P* m# An error report file with more information is saved as hs_err_pid1064.log |