我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。. l, C/ t/ h: U# P. F
import swarm.Globals;% I/ A, T8 F. A/ i0 f
4 K: J6 i0 C. W+ d, ?
public class test {
& Y) Q/ M, v# Y7 X! k0 P /**: H' h6 F! u4 |! I# L1 c# E% p
* @param args
! ? b+ r0 X# R( B% _2 D% L */
1 C5 v9 T' F2 V8 t7 v public static void main(String[] args) {$ o) h, {; _9 D/ V5 @
0 u) G* S8 i1 L5 J. p int y=(int)(10*Math.random()); B" Z* _4 S: ]' q4 }2 @, k
System.out.println("result is "+y);
2 ]! ?: I( K0 H U) }( J4 E; Z) M5 P
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
7 F# @- ^5 H/ E2 V5 R8 [ System.out.print(z+" re");
1 y4 x: @+ J5 K; I$ W, d }
; ~8 Y6 U0 k A( V, g}" Q; D9 Y+ f4 L- V1 a* V2 t
; F+ H( R3 ~. |% a0 T* o
结果是:- Q) T T% l! P% C9 W- }
result is 2 K5 `" N. h4 d! Y. F" o( I) w
#% X2 A, B! Y ~( t1 ]
# An unexpected error has been detected by Java Runtime Environment:6 L& v; ]3 j8 ]; X1 {# K$ I# f% ]
#+ P$ y; k6 |4 c. c0 R, A/ T
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10680 J+ C2 I# P1 [3 P0 k: Q+ \# K d
#
* o6 I; [& y8 o* N& s: y+ {# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
- O; r& X! l3 l. w# d% u# Problematic frame:( g8 P$ X3 j/ k3 `: |, l( n* q4 a& j
# C [javaswarm.dll+0xb8305]7 w9 \1 W* j; P5 c+ F
#. z4 L! {8 S& g: J3 A4 r
# An error report file with more information is saved as hs_err_pid1064.log |