我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。' n) n/ x/ t5 n5 x) `
import swarm.Globals;
$ D! p* T8 O4 d7 h: U
& p6 m# R" d+ R! [0 [& [1 @public class test {; z% i* z' Z1 n7 k! V
/**
/ |. B9 j7 h! V* S3 ] * @param args) f6 ~5 e6 o3 d' W! l) Y# n# ]/ x& [
*/
3 ~* a" H6 u7 \0 m public static void main(String[] args) {
8 g0 ~4 {8 r0 w2 T" \, y9 X . J4 n' j1 {' W/ C: w4 K
int y=(int)(10*Math.random());
/ Y; y/ x5 M! U* z% ~& z System.out.println("result is "+y);
. Z+ _% h3 F# R6 k
; D* g% L7 f3 ~) {, X( J double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 u3 n+ O6 X4 V& a5 g+ ?
System.out.print(z+" re");
: ^, L& y4 n# w3 l$ ]/ ? }1 N( g3 B0 ^3 q0 D$ Y: Q) }" R/ D
}
% @: `( J/ K8 a8 n
9 B& j( e/ u9 _; y# J5 {+ [结果是:: B1 v' _/ Y4 p( ` [* F
result is 2
+ `* V1 m. `: {% A0 t3 W9 W5 T#
2 U( P x/ O* q8 Z& o8 |6 G @6 @# An unexpected error has been detected by Java Runtime Environment:' S8 I& h9 ]. W! n+ V3 ^' l
#
; U0 T; H0 n$ B: y7 _# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
* Q. x0 T; q' a6 ?# L#% r* E- [. |. p% A* |
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
5 V: {0 K& ~- ^5 h) q* n# Problematic frame:# K* R: X0 ^4 W. N6 i
# C [javaswarm.dll+0xb8305]
& _0 S: V% Y1 e5 C2 j#& [9 B# Y4 @, R3 R8 k$ ^4 G
# An error report file with more information is saved as hs_err_pid1064.log |