我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。4 n2 h; h/ N4 |! [
import swarm.Globals;1 \3 Z" c" I# D
3 j. [: D! Q. k" ipublic class test {
* @& m2 z( _4 f% f, O /**$ W% }, k8 Q' ]1 a
* @param args% @; V& h( l3 _1 ^
*/& a( R0 S% m" D* N
public static void main(String[] args) {
# Q2 R s7 L% n# I# f' I4 @
6 s* v# m( d f+ m1 G int y=(int)(10*Math.random());
' ^6 i+ P% r( T/ Z) K& v; s System.out.println("result is "+y);
, y; h. ~& d1 P
$ q) f+ j; I3 o1 i7 y1 y double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ t, ?, d$ `: _2 Y9 N0 h6 K1 K
System.out.print(z+" re");$ }. u6 R9 I* B
}8 ]8 L2 {" g3 O, \' T8 m
}0 Z8 \! {* d/ M; ~( k# a% H
) T& H$ m4 x3 }- I4 ~. I1 T: N' w结果是:
$ Z% b# R# T& H9 c4 A% |: W, W9 oresult is 22 q; F. V" y7 p8 ?% Q
#2 K% p: G. s* x' N5 l
# An unexpected error has been detected by Java Runtime Environment:
1 r( t" t8 F q% e#1 }6 V3 W- Z: c% T$ h- x
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
. J- L' J/ C9 T7 v## i& M$ }" M/ m0 _% }% b8 t
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)8 I) G g0 P: ^8 r% t& @5 s+ C( x; V+ w
# Problematic frame:; X$ c$ \% M; f: Z! k" M
# C [javaswarm.dll+0xb8305]3 y& X' w) r( X2 K7 _
#
5 D6 x' v) y$ }' ^' D& C6 X# An error report file with more information is saved as hs_err_pid1064.log |