我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
, l0 \" t0 H) m2 Himport swarm.Globals;
7 v) w* Z* d e3 }( Y) L! T' [% ^: I! k. x) _0 U( _0 `
public class test {
8 f7 ]/ ?0 n% { }; Y /**0 C. z* F$ I& G, \
* @param args
0 D s3 i$ a' f) D* P/ N6 C- L V* ] */
5 r7 w x4 ?5 [2 [2 I" { public static void main(String[] args) {
$ A1 T; G& Q8 M9 R: L1 l , I* F+ p: r- w* S. c. c
int y=(int)(10*Math.random());
& F9 x1 r# u f4 \& k System.out.println("result is "+y);
- q1 N( M) L" O3 z0 \3 Q
e" y: `4 V1 c* y5 ?: K double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
, q: S% l m; ]. p w+ i System.out.print(z+" re");
3 r# J2 H- T; { }
% X4 F6 G+ b1 H3 D/ I}
/ ?( k) X* n9 ?+ k$ y/ f% \+ ]5 R* _% v3 B9 E
结果是:9 `" c: p5 |1 ~( \ k8 v* q
result is 2& k: m4 f" S, u8 W, L
#" H; M( u. p* V
# An unexpected error has been detected by Java Runtime Environment:( Q/ h3 c4 `& L# F7 J$ b6 o
#) Y S9 X1 t4 e! X$ a) f- X5 X: W) x: b
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
# Q) E* g2 K* V! V- Z8 f#5 l% Q1 P, D+ k( {7 w3 Z
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( P, Q: R0 T5 \$ _8 _( R
# Problematic frame:8 t) `$ Q/ I' a2 M" X
# C [javaswarm.dll+0xb8305]
' A; C$ X( g8 M6 I! T#. N& G$ q. u/ P u& @
# An error report file with more information is saved as hs_err_pid1064.log |