我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! P o, n6 I; S7 D4 Himport swarm.Globals;
8 L' p7 d( J; l1 j% O, u, M& w# w# o9 e! B
public class test {
. i; E- l" q1 V! K1 f( M u /**1 H* _7 N; ?; ?2 Q1 ^6 O9 Q* U& Y! W
* @param args5 l2 j2 p9 u2 j, T0 S
*/5 ^3 Q/ H3 p" Y& i
public static void main(String[] args) {) }0 b* V8 ^; Z3 M t
, `* k8 ?8 d% V- P int y=(int)(10*Math.random());
8 ^' R) g2 f, a1 {$ ]1 o m) n System.out.println("result is "+y);6 a O# K: O+ E8 |, B, ~- H
% ?/ z2 s, {. M0 G: v. M0 K double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);8 T) x7 V. D7 p- l8 N* M2 I
System.out.print(z+" re");
' w# x7 ?5 Z, O/ o: | }; c3 S& ]" C1 t( X9 K# F7 l
}% G; K/ b' n% o x, j
: q* s) I3 v( W' G) z$ Y结果是:
3 R* U# J% g S* \! Jresult is 2# F. B/ R6 z% u* g2 l6 _( e
#
' A$ }$ i0 {% y# An unexpected error has been detected by Java Runtime Environment:
3 v: c F( U; ?2 y#
c- n1 C, T* Q) Q; i# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
* z. t2 Q5 U: b5 ~) R4 n2 @. E#
4 K. g; U' ]. f1 l* j. @0 G# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
, [7 Y7 E- v* C/ l# Problematic frame: @* P4 p& X/ f5 {; F% ?6 P4 h
# C [javaswarm.dll+0xb8305]8 Q3 A. q ]& ]% K
#
a2 I, m2 _/ I! n: {4 P# An error report file with more information is saved as hs_err_pid1064.log |