我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
1 w" U: } |5 k% H9 Y6 |- Z4 G7 cimport swarm.Globals;
$ c$ D+ J7 e, j, Q5 v3 H+ S; X" `% `. g0 N9 N
public class test {
" y/ j) }+ X3 d6 p% q0 G /**, W* H% e0 ~3 T; |$ e2 F4 @! e8 s8 r6 h' r
* @param args
/ p' p9 S [. j* _! A2 x */
; z7 ^. T+ ^5 { W( c$ i8 g public static void main(String[] args) {: j! s% h5 W p+ k% q# c. y" n6 E3 [9 D
- `% L; H7 l7 h+ ~: p) J. t* m
int y=(int)(10*Math.random());1 i. r: z! n' p$ h
System.out.println("result is "+y);# d: G. {; _" ?) M1 }: M
+ y" h. m8 E1 p* ` T8 ^5 o
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
9 M; q# `* H+ ]5 K System.out.print(z+" re");" ~8 V3 J6 e! _+ Z) i6 t! d7 Q
}
6 E' q# |( y1 r; t! v$ r3 s}
8 J3 z; Q: N* g4 J9 m
, \8 w1 Y% ^( ~2 u* r9 ?结果是:0 D% r& V+ x& Q w* |
result is 26 L2 _0 X5 S, X- ^2 Y
#
( _1 h( n" j* }# An unexpected error has been detected by Java Runtime Environment:; {' C! }& K3 r5 S! y
#2 [# |! {9 D( G! S1 d
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068# b$ Q' p- [" S$ W
#
# B" b0 R( f; f% r' Z6 z# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
" P% e, |9 t4 d+ L4 S( P4 g9 S# Problematic frame:
; T/ V9 c" m* [, j: b; T3 G7 x. [# C [javaswarm.dll+0xb8305]
7 g/ h& Y& K$ d# y; C#. I/ D+ ~, r) J* Z. B/ G
# An error report file with more information is saved as hs_err_pid1064.log |