我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
& |2 \# l$ ~: z$ I- g' ?3 v7 Timport swarm.Globals;
i8 M) W: [6 u; V' F1 G) ~# I3 g: @% |. a
public class test {7 @1 X' Q" Y5 L# x6 P3 s
/**
' l: Z8 @, t% E/ Y7 a7 p% k, C; b% c- J * @param args1 h/ k; j" V: C/ }9 z% b+ |9 _
*/3 ] e/ ^1 e+ D9 |: }
public static void main(String[] args) {
* @: ^4 P/ d2 @5 d+ H; ^ 4 ^8 ^. s! j0 Q
int y=(int)(10*Math.random());
- S5 p1 g' t- c+ u- ~; J& V% Y" y u" a System.out.println("result is "+y);2 Q, i" C, p" A. }5 }- ]7 ]5 V
& G* I0 Y2 x1 {2 J! z6 Q+ N: J* j7 P
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
, b( U3 c b5 e) a System.out.print(z+" re");
4 g2 n# K/ Q7 f0 W# `+ a, `! m8 | }
& k. v; z5 |% {+ x}0 [, o$ {" j1 R
* g- O6 K( D" i: h/ c结果是:: w5 i" W3 E N2 C3 f0 S
result is 2$ \. x( G! u# I
#
% }& R. t6 k5 H! _6 t% Z# U4 I' P9 l( j# An unexpected error has been detected by Java Runtime Environment:7 K/ U7 U! H p$ U* E2 l
#. @$ L8 v+ ^) B9 y5 y
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068* R( T' D' {" r/ H% h5 G
#: v3 b0 {# L, j4 x9 C h
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing), b" b: |& W% g. k0 ^0 A
# Problematic frame:
% Z% e! S U$ z# C [javaswarm.dll+0xb8305]! x- g/ }$ l; H+ n) `) G! M4 z! ]
#
9 P7 q, k: O u, }# An error report file with more information is saved as hs_err_pid1064.log |