我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
+ @! D4 c' p$ Yimport swarm.Globals;
) `8 v1 l7 i$ z3 a- l k; A9 {2 y9 O
public class test {- n! c7 V) F! W3 Q) ]! l' {$ r
/**
" ]6 q+ _( A' ?1 B% ]. h * @param args2 w6 R$ ~9 @! X. x& L
*/7 m5 {% P) t0 {1 P# v+ z
public static void main(String[] args) {
* s6 P4 ~5 a1 G9 ` " n& |: C2 x2 x% {2 i: ~1 W; H
int y=(int)(10*Math.random());
# f6 D4 L" e1 c0 B& G3 b System.out.println("result is "+y);* u& m+ g& ~% {) h/ z
& e& n5 K( L7 b, {6 M7 |) j double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);: E- j. ]" N9 j( [5 ]5 M
System.out.print(z+" re");1 ?" c+ b7 Y9 e4 H, n$ c
}0 R* s% R5 g" U( S' x
}
$ w: j- D8 T* P! G
: p3 `9 K) ^ l结果是: \+ E- o3 _, r
result is 29 C; D# F/ ?- G$ v" K; Z
#' R( `4 `) i2 e9 `. B( I
# An unexpected error has been detected by Java Runtime Environment:% d. v' ? y! T4 `$ _' b
#0 Y/ L: \- {& ]% C) q$ A, B
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068% x, {' O7 y2 w
#. t7 E! w$ \+ e/ t. N
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)6 g) o, S+ g2 G7 _% U
# Problematic frame:
* L* s4 T5 I3 S# C [javaswarm.dll+0xb8305]
7 a5 v j4 k6 [7 q#
; o" R0 w6 @% x# y5 C# An error report file with more information is saved as hs_err_pid1064.log |