我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。0 Z7 l2 I5 Z& f
import swarm.Globals;
0 f: L3 `* `5 j+ j5 r4 N& d! j1 W& U9 u1 u/ m- d7 \0 D
public class test {4 `" {' f/ `# d
/**: k; t3 K' `+ z, V; a
* @param args6 r: t5 R3 w# t2 Z
*/% D# O5 y5 f4 B$ _! T! r
public static void main(String[] args) {
. y* C5 _0 z' @
3 f, A G- ]+ \1 e% s; I. Z2 \+ h int y=(int)(10*Math.random());
- E9 _! m- C4 t: k+ j4 I System.out.println("result is "+y);8 [% O8 ~) Q; F# l' h
0 T& N2 L( U8 W1 b/ Z+ I2 F7 C# X
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
% {' C/ ^; G7 ]- l, _0 F9 F! [9 H System.out.print(z+" re");
$ d8 t8 l* X/ {5 H6 j+ Z3 j: g }# u3 A8 R/ t: o4 g% j
}
6 c8 C( u' l0 z/ b) m. ^7 y+ R( @- G5 S; D3 \2 h1 E: z6 S1 J
结果是:
9 N6 k# h! x& |; l2 S: Dresult is 20 }3 Z+ f7 @: S. m( m, j+ d" N. U
#
9 r1 E& C6 [" W d% z) d, D# q# An unexpected error has been detected by Java Runtime Environment:
0 N1 x4 Y! H- T& N, s$ q7 l#
$ X2 L$ ^/ x6 W. K6 r7 C4 b5 Z* {' j# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
8 b4 O: D; d6 F' ~' l#, \; h9 g7 z( e% U! s# g( |
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)+ p* Y4 l7 V: R9 d
# Problematic frame:2 x1 U4 U5 k- H$ @. F) T
# C [javaswarm.dll+0xb8305]
# o6 E# ^7 X& v( k#
2 x1 X" ?3 B0 n2 U( {# An error report file with more information is saved as hs_err_pid1064.log |