我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。4 m* q) g' i8 G( y: {
import swarm.Globals;
: U, l8 B3 q" a% U$ Z2 C2 b7 b" t4 l' n0 F9 T# `
public class test {
( f0 y$ I/ G; q( ~4 d /**
' R! y8 Z- j4 G6 r+ a( z * @param args
' Y2 u3 U" M* G" b3 M6 f */* B; q3 x" F2 {$ q* n6 @
public static void main(String[] args) {$ O& U1 L. c9 |; R6 D
# H/ k! |7 a; z4 z( b1 Y( Z( ]0 m
int y=(int)(10*Math.random());/ b* W5 U3 M7 p$ W# s) r, K* g
System.out.println("result is "+y);) T" w" T4 N- k' |0 j2 }
0 d5 |7 f# z [- h3 i double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);) g' Q! J; i8 z
System.out.print(z+" re");3 k, C% [0 u' ^1 Z! T+ Z" P
}
6 o' r. g$ j% O/ A}
( E I# V- U7 q/ j9 l5 W
1 o7 M% |/ y/ l& ^结果是:
' K0 I8 ~% W9 j- H% Eresult is 2
0 b1 \0 N, {8 v' X#* O) N7 N% {+ c. ~' c- m* w; D: C
# An unexpected error has been detected by Java Runtime Environment: v* l l4 n; U, E' k7 c
#' {3 ^' J+ ^) G8 ^- n6 K, f
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( s, @; r9 X8 p3 b9 `#5 i+ S4 z. Z5 q& t ^2 a5 O
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing), h3 ^6 v* c& x1 o
# Problematic frame:) {8 t" b& D: d# p9 H# N
# C [javaswarm.dll+0xb8305] B+ F$ \& n3 @! j) D$ K; t
#
1 H9 u% N2 c7 m/ i, O: g; t6 {# An error report file with more information is saved as hs_err_pid1064.log |