我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
! S8 F) L) j8 e @import swarm.Globals;* |4 Y7 M# U7 X7 L ?
/ E" ~! X9 C$ H1 j; _public class test {- [0 Q, T& n8 L8 J, _, e
/**! S; Y4 C4 @: F5 Y, Y9 I
* @param args& |4 s. [' N4 W t2 [9 U M! n% }0 o
*/! Y) B4 ~5 @ Q$ j
public static void main(String[] args) {$ k: G, A4 Q; }3 E/ C, A
6 o( F8 a6 K; R6 k& ~
int y=(int)(10*Math.random());
1 P0 s# d- V- M$ U System.out.println("result is "+y);
' O! i: M: F! W$ b% e7 p) y, C) {8 e* l% ^& q" S
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);/ p' p# {+ w, A k
System.out.print(z+" re");6 h: ~4 C% |. a# ?" L
}
r9 ?; c" ^; U! Y4 p} J/ a; k- L- j4 ]5 G: B
. s# ]' }& H! R- `结果是:
( {4 d9 D% G' n! {/ Eresult is 2$ _ _/ i' Q L, j
#- B, u: V1 r8 L+ ~$ k
# An unexpected error has been detected by Java Runtime Environment:
8 j2 }% v' r$ {5 i( [9 g+ g#1 u4 w9 R, U. Q ~* y+ V
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068! _ U' [4 f& J5 V" [$ i# e
#
$ l' o6 k2 f: j3 U- Q* w( C# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
' \' `( k; \0 d; @* N. h& [/ N# Problematic frame:
- t+ g5 V, W8 `9 }. F6 |# C [javaswarm.dll+0xb8305]. O3 J v( h; B( u
#
* A. b$ c1 o( x" W* A1 k# An error report file with more information is saved as hs_err_pid1064.log |