我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
2 i! j7 y+ ?( |% C, aimport swarm.Globals;+ t' H9 g8 ?$ w/ o" @4 |
7 C8 {: i8 b p5 _: g+ z
public class test {+ b5 F1 H. s- ]
/**& P% U- ]5 Q! c1 E2 D: a. l
* @param args
* [# U5 Z) k0 j% m4 P */
0 T: I& m( g- h0 t5 T public static void main(String[] args) {
5 L4 c& A7 h. L' i" U
$ ]# a, W5 z! z int y=(int)(10*Math.random());
5 V# f1 O5 p5 f% v; a3 Z: q* l2 | System.out.println("result is "+y);
$ V! G( f6 s2 {" R; A8 N2 Z2 w/ \8 R0 x) {
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);+ B$ K7 e" n1 ]$ @
System.out.print(z+" re");1 b# A0 Z, }9 |/ M0 v! ^
}! |6 l5 r" C4 d! S4 l3 ?# `9 N# ?6 Y2 L
}
% k8 e- ^3 s5 S2 y
, x: n5 O8 ?" V7 _结果是:
# m& C5 l, N: [( }% h. Nresult is 29 ?& \# v/ u) j; \) [
#0 E+ O6 s6 H1 ?# X% L
# An unexpected error has been detected by Java Runtime Environment:5 L2 L4 L6 ?' K j) X( x
#5 L/ _$ e3 @2 w
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068; |5 a6 m7 q' g, {4 h
#4 M. e9 J4 I8 N) Q2 Y
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)4 h8 r! [# K5 O" [1 y2 T4 Q
# Problematic frame:
5 f: M: s' {2 l8 P# C [javaswarm.dll+0xb8305]
/ |- d' z2 o7 m" I% e1 _#) {6 o. P' }5 d2 Z
# An error report file with more information is saved as hs_err_pid1064.log |