我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。% g6 N% G/ H, _8 q3 m
import swarm.Globals;
( n' _5 X1 G5 O; G4 }5 L& h6 c1 `$ e2 n+ l y/ r; t
public class test {+ U0 B. K$ \+ L$ y5 ?, l
/**1 L( t# G' ~4 p9 Z& r
* @param args6 f7 J) {$ V4 d U% W: R
*/ C( v+ K) ?: B8 G% N
public static void main(String[] args) {
" k, F1 z& h; F% X# A$ P0 u: I 9 R% o( J9 w7 X1 a* t7 `
int y=(int)(10*Math.random());3 x. I* C' t. m& {$ l( s
System.out.println("result is "+y);
0 S7 V" K, @6 A
0 @6 i, r* a* `! A4 ]) }) r double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);9 k& Q$ q7 R" z! \
System.out.print(z+" re");, Z/ f) c) r) h# ^( d. r4 I# D
}
. `- @; P' M" I3 n! z8 e) w}) k; E/ h+ X' Z Y8 S. R
2 v' B0 O; ?# `$ U# [$ `6 ~1 h1 }
结果是:
4 | Y& l4 ^ wresult is 2
1 R" g. w* F/ ~7 c: G, O7 g" V#1 w& B. ?8 z- }! ^ @- N
# An unexpected error has been detected by Java Runtime Environment:' I- d E; D. @3 @
#; ?0 z- w) M0 G! X% ]- e/ ^
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068" F0 g p( B5 n5 c( Q
#
; _3 N# F, t( O( [# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)7 R+ v1 {; z2 g) C, d) W
# Problematic frame:# n4 x0 ]! P: o' a8 f* A$ T2 {' R
# C [javaswarm.dll+0xb8305]
, Q4 K: w5 } b& U+ d7 K7 G" M#. S9 q$ V5 @4 A2 C( M5 J1 ~, x
# An error report file with more information is saved as hs_err_pid1064.log |