我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
+ n# f7 K4 M% B4 [+ |$ timport swarm.Globals;; c/ J p# e5 j
+ c9 q9 T) e/ y$ ~8 J: ?' D
public class test {& R2 E$ h0 x" k3 n$ `1 e2 I) }4 k5 h
/**
$ N2 S, M- p6 q * @param args
" V% w, n; i. E6 I */
. w5 |' D1 P) G9 F- \! P7 R. c public static void main(String[] args) {
% V+ L+ d1 |: V6 z/ M* ~. L k# a 5 ~9 c+ f/ V3 w4 I7 o5 S
int y=(int)(10*Math.random());
& Z! ^: \2 s; N System.out.println("result is "+y);+ l( e, j5 r8 ^
2 B4 {; j4 D6 V5 C% q+ z double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
5 Z; e# c2 C8 t; m) `! Z5 u System.out.print(z+" re");6 H" N: l6 `! w7 N5 a. E/ n
}
3 U7 U: g: s$ T9 \) i}" [' I5 A# j, x8 S6 T; B5 q# ?
! X1 Z& `" J9 c. B3 e; s结果是:
* r; m) H8 V, V8 d3 C5 f4 iresult is 2
, Z/ C, Y2 y9 u, l/ X#6 c3 P, E, \9 @( T4 \4 E) t2 C
# An unexpected error has been detected by Java Runtime Environment:
- i- C# j/ G {#' w3 A# d( y* o* I) J5 T, K
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
2 n6 Y1 ~" t# ^3 h0 C#; v( m- [# [# T7 }0 o1 X
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( i3 Q a; H4 S! I6 c$ |; g0 V
# Problematic frame:2 ]* o) z; A( v1 C! F9 x: m
# C [javaswarm.dll+0xb8305]7 O: f9 O& \+ P- g8 k- ~$ j4 [9 e" L& ?
#
- I7 j: X3 [5 t! I6 j& f! T; N# An error report file with more information is saved as hs_err_pid1064.log |