我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。( ]& ^0 S0 k3 T3 O; _
import swarm.Globals;2 h: S; e: ?" b5 L2 T m3 w
6 X: c, Z1 s6 G2 M& U2 U: L, f
public class test {' _ Z* [: p# W: e
/**6 P% p4 r( J1 ~) q# P% B" ]
* @param args
1 {* A1 g3 k) L( E" }1 ?+ f4 c */
* ?3 [, X$ w/ V: _/ s# p2 ~9 i public static void main(String[] args) {$ @1 H3 z' U0 ]! C5 ]4 [
# B) O7 u6 V1 W$ B0 L1 {
int y=(int)(10*Math.random());2 d9 T. r, Q6 G+ Y8 Y
System.out.println("result is "+y);
# ^9 {& f- m& k: l0 o
; n4 T* q8 C i: \. h; \ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);* s+ R) Q; S1 p( G% t$ ]
System.out.print(z+" re");
. z! u6 M: {# Q2 d }" O7 i, q3 F1 a1 n# `# `3 P7 R
}" D4 N4 y* w) m6 Z% _. f
$ ~4 h" t/ u1 Y8 F1 x2 j) j% i结果是:
0 c6 A) g# A% b* Mresult is 2' ]! u G1 X) E- S: A* E x# ~
#: d% E* V# Y2 n2 L
# An unexpected error has been detected by Java Runtime Environment:$ \4 ]$ Q% q3 U! k# T! R" V" y$ Z
#: O+ A! t# f4 S; z3 Z1 B- e
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 ~7 }" O! {3 y+ Q! ~" P w# k7 b#) h& t. `! ^1 p$ @4 m
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)6 A) V/ `; `1 j$ ], M5 _& E
# Problematic frame:' \, c0 m7 [$ X
# C [javaswarm.dll+0xb8305]
* L7 ~* p, V( `0 K. C#
2 f" D3 s. P. `. T+ B# An error report file with more information is saved as hs_err_pid1064.log |