我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。0 Q4 k! M0 I/ y- O+ l7 F/ A/ r
import swarm.Globals;( N3 D3 q; N, {6 L5 }4 P0 B
2 i2 f7 y: c1 S; e/ H% [' g
public class test {
0 x" E* n. ~: y8 N% D5 J /*** q, b+ |; F! v/ O% f
* @param args
1 [4 y( P' F2 P */
) H: }" v. n9 C4 _% Q! b4 P public static void main(String[] args) {
# E! l+ G+ G; C# A" N8 c 0 ^, f$ L7 j, J
int y=(int)(10*Math.random());
8 K% r4 B) O5 r0 X: y System.out.println("result is "+y);
/ T# j4 L# c9 d3 t- |+ q6 S% `( y, @5 A! B$ g
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);6 [+ {) R$ Z/ W/ G
System.out.print(z+" re");( }7 P2 [' V- P% G+ a/ i2 Q
}
8 l" g, w+ ~( @. y} Z$ j |: I7 q
j+ `7 g9 ~6 O% F: D4 K结果是:
& S6 P7 K! l2 l# {( sresult is 2
+ o& {7 Q' B1 a. ~% Q) j#+ _* b- j# A+ F/ M
# An unexpected error has been detected by Java Runtime Environment:
$ U0 r# |, p! j5 y; i0 r#) x* ^6 r; |2 A$ @1 T7 [
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10686 b7 \1 m2 V0 b6 u, F8 P f
#
8 n/ L. z* w% m# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)8 ~4 f6 M$ j0 W, D
# Problematic frame: W7 j( S3 {5 c7 E
# C [javaswarm.dll+0xb8305]* U% ~$ a( F5 e% N$ s
#
3 @' w, H) Q+ j7 E8 u9 n; l# An error report file with more information is saved as hs_err_pid1064.log |