我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
9 R! L! I }" E) v" yimport swarm.Globals;2 o V0 f2 t# B( W- X# W
8 a F, A$ v* [' ?4 [% j" G: m# r
public class test {8 {9 N7 l: d3 ^2 t; _( i5 C* ?2 o
/**
) t9 s! `+ T5 \6 u; r" h1 d' r. ~* q * @param args) D+ o1 C: @) g" B
*/4 n: h( O* k( u% C3 z8 I8 T. A
public static void main(String[] args) {
( [0 E8 V* p% m% h, @# O6 B
5 S2 s2 `. v. W5 v- K k+ Z4 g# u int y=(int)(10*Math.random());
' _5 }+ Q4 u& B- \ System.out.println("result is "+y);
4 H* D& K5 B- M0 Y4 A1 A2 G F7 E
. S* `1 @, K5 k2 J1 A double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
' R; ^! X9 Y0 | System.out.print(z+" re");
" u, ]. T9 C" U; J4 N }
2 W6 Q6 U0 y) ?7 n- v$ l F}
; l _7 A! i9 q3 k2 q
+ `, D1 e* i- t% ]9 j% v2 i结果是:
$ H# R& |3 M" Z; cresult is 2, f% W3 T" X4 l- ]
#
' w* F# E: ]+ d: R7 N2 p; y Y# An unexpected error has been detected by Java Runtime Environment:1 F) x3 n$ V" Z' W9 P/ M
#% u* f( l4 h2 T
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
6 p& r0 z- X6 g: m1 H: B#
) }$ \: T8 {& @! r! l1 a# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)( W9 \$ }4 J9 w8 S( D. `
# Problematic frame:
% b+ F* K n- A4 n( b# C [javaswarm.dll+0xb8305]
$ [+ X: t! |5 Q- z( J/ K#! r( t0 r' w$ B# I" j I; n! C! x
# An error report file with more information is saved as hs_err_pid1064.log |