我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
) ^$ d/ ], q% ` _4 u% W$ Gimport swarm.Globals;
# b; H5 E. A, u' p: g; N; L9 f' L+ d A2 ~6 S
public class test {
6 O" t& Q' l4 ?5 T4 I5 J /**$ t- `% a0 f0 j" u
* @param args; J: s6 Q: U( q9 S# F* h. n9 L
*/
3 m/ Y: |' G; k2 n. B5 J9 l# ^ public static void main(String[] args) {
7 r0 e4 a4 m; C+ Z
$ K: u U8 j( T8 U int y=(int)(10*Math.random());/ Y' o7 K9 g8 G) r) q
System.out.println("result is "+y);! T" K; Y+ L0 R
6 r g6 y+ Y6 R9 e9 A7 l
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
+ q0 i( w1 e9 [1 m+ E- U System.out.print(z+" re");% z7 M4 E( w# x. J
}5 I+ b, n) H9 l2 z% i4 u8 l
}
5 H* \5 |/ c- T: f) i# H2 e* R/ `# @! i5 i! `* R' g
结果是: f% l( |2 X$ e; R
result is 2
* N% B7 u9 u) u5 W; _4 S#" _: z: W7 T, x1 i
# An unexpected error has been detected by Java Runtime Environment:
; A J/ A* r- B6 p0 E2 y, x z#5 g2 E: ?& Z0 s2 J! z5 S6 M {
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10680 R1 M5 }; C' G) ]
# [% f9 O4 x4 e, r5 k7 [: m% o
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
* G% a3 Z' f8 A4 M6 d3 r& [# Problematic frame:+ a Y b" @# S) |5 {4 x. v
# C [javaswarm.dll+0xb8305]2 U. z0 L; X7 l8 U/ K/ }5 @ t) u1 m
#
: M% _: k: ?4 W( P1 _) X# An error report file with more information is saved as hs_err_pid1064.log |