我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
$ o! I8 X( ^0 J, Cimport swarm.Globals;
8 W6 Z6 L% L" f; d: ]$ Z% M6 h' ^- }# g# M
public class test {7 a) w, t& J/ K, ]) e2 ]
/**( l" a6 V8 Y' _; B, { a$ j
* @param args
/ q! M1 z4 s: z% |% Z) B */
" m- _3 K, P1 h& C* w4 ^# `. | public static void main(String[] args) {
% L5 ?! M5 j" A0 }5 O' {
" `( L, I8 T- z) c# \+ x! ^ int y=(int)(10*Math.random()); P9 s$ E7 K; ~1 a
System.out.println("result is "+y);
- \3 p8 P/ l/ H- X3 Z: d L* t" k2 ~. c( a
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);/ J! s$ y( _2 K/ c P! ?
System.out.print(z+" re");( E1 G, q) B- R* t/ p
}
1 }) M( r) Y( ?2 G) }* G}
4 n- n: L. R( P% | F, [
" H, @. T8 s$ j5 L; s0 ]$ n结果是:
& K3 b s, |% o& ?, S [: R4 cresult is 24 X6 W2 x$ |$ S7 l: F6 s! D
#
/ |6 i% s/ x ^" x2 Q* @. F9 w# An unexpected error has been detected by Java Runtime Environment:
# q3 _2 _! |1 J+ _/ U#" j2 s2 |/ J2 v
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
- _5 r6 l8 I8 }+ w! ?#
/ {3 c' s F; P& D% q, z, Z# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)& x. G- {+ y7 g; d+ Z M
# Problematic frame:
4 o+ V# H7 [ d1 f6 b' u- I# C [javaswarm.dll+0xb8305]
4 l# @& S2 g# g% y% J' F#
& y, `5 q# L; b# j# An error report file with more information is saved as hs_err_pid1064.log |