我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。9 v/ E" `. K9 j& ^
import swarm.Globals;
1 Y j# L) l8 i1 e4 r9 a1 ~
* v" [9 a6 {3 T) c) x% n7 o: ppublic class test {6 }6 i9 d- ^. s
/**+ y2 L: e9 s! |3 I" j
* @param args( O( F2 O' B& ^9 V* B
*/, x+ F! \. S' T- }& {# N% C+ ^
public static void main(String[] args) {
, H P9 ]8 b4 n/ \% `. s, L
# E; q+ M0 V* u) J$ K; p int y=(int)(10*Math.random());' ~$ Q, B6 h9 T) }7 m8 a) }
System.out.println("result is "+y);
9 U, F% |& j' w1 B
/ V4 J# {: a4 w0 R0 v* G double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);" j2 t B( k% E/ _, `
System.out.print(z+" re");
! P8 l% |9 R* _# f" g }+ ] y" s8 N! a+ I
}
) V7 g7 Y5 T. o% ~" f
8 z: m. C0 ?- @# Y4 v0 e结果是:
/ i; I: I+ {% B/ {: V3 K5 E) |# mresult is 2
) |' O0 f x6 l1 P0 \! n* G9 C+ b#. d$ j. V* z. X; n0 l2 H
# An unexpected error has been detected by Java Runtime Environment:
, ~ i% M8 q3 v$ I0 K4 ]3 o( c#
- Z% h, g- f( I. S! ?1 O' e6 H# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
* n$ ?, h; b. a. _7 B#
- o( @! L! T7 o+ E/ r) {# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing); ^. d. P2 g4 t! H( Y1 r
# Problematic frame:
/ f _- S! N9 W6 U# C [javaswarm.dll+0xb8305]
/ O: D4 Q0 n( D; T- G/ \* u## |" d: V% v$ A i8 R/ z& R2 `
# An error report file with more information is saved as hs_err_pid1064.log |