我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。1 H8 }( i3 \% S# G
import swarm.Globals;5 R4 o( d; _1 `; m8 U) _& y8 i
" Y* [6 t' B, f* Kpublic class test {8 B& h) U Q$ k
/**
. |; U! T5 v4 I# Z& m3 z * @param args. O% P; O$ L' |2 M% V7 D* I+ {
*/
8 k2 [; _6 S0 c, o' ? l public static void main(String[] args) {
% ?' Y& k# F0 [: C& @* d & |& h9 o2 L$ S( \. p6 P0 X
int y=(int)(10*Math.random());
( ]. Y2 g7 a& T: F' T+ Z System.out.println("result is "+y); _ f+ g: S2 ^
0 C5 u& R0 D8 Y) x double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);# F$ o" \0 T; f/ ]! ?' s& [9 Q1 l
System.out.print(z+" re");8 A, P' }0 j( ~+ A- K
}
) v- X# K; h" A2 O0 C7 y* V}
: P) U! ]! f1 e! c* K* w2 _" D3 q
4 o' s3 e& W* @结果是:
2 p& ?& q' h' ]/ T, m9 \result is 2
9 `$ u ~' z0 g% O- s5 }$ J! c#
2 S2 X' D7 C8 N. [9 p; f+ |# An unexpected error has been detected by Java Runtime Environment: w7 y- t* X g' f3 g3 _
#0 ]3 [- K5 l5 d9 t9 o
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
8 a0 x A: P8 b* H& l! {/ R. m#
- R6 @, T8 b" P8 \! M% P9 L# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
) l9 n' {% z0 L2 y8 ?7 l# Problematic frame:
) D1 K3 A6 F1 s9 A1 I' ^( r# C [javaswarm.dll+0xb8305]
+ \# i8 C2 y( d+ f) R#
5 m$ q! ^0 ?3 V/ Y* w6 Y- A# An error report file with more information is saved as hs_err_pid1064.log |