我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。) q' [& p3 W, z1 f
import swarm.Globals;' U; e8 g2 y6 \6 \
. u' w3 q) U' k2 [; E
public class test {. X3 w8 P5 A6 c- e: |
/**- R3 E4 {$ } T. Q. `
* @param args' W k0 ~. Z# s+ [/ f2 b
*/
9 c% t" A; U! g# I( q( D9 ] public static void main(String[] args) {
1 W" K) c( G& @' G$ l- a
' L+ Z- ?' a+ `2 G6 C int y=(int)(10*Math.random());
+ X8 z1 x4 K1 P! } System.out.println("result is "+y);, d3 s. p" m3 B* B* J# O. P- V( B: m9 \
8 t4 N1 }% y9 ]! @3 [ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);3 W" Y- Z3 `0 s
System.out.print(z+" re");1 u/ q' S6 b" P$ w! U
}1 t% o/ a9 C2 `, G7 i
}
0 r# c' i9 {8 \2 B- K1 y" I; T* x& P) j
结果是:
" v3 q1 K2 R: T% z. m! V yresult is 2
# r% w- O3 g# w#0 \& C. ?; m: n5 Q
# An unexpected error has been detected by Java Runtime Environment:0 h D' U- S% w$ O
#5 F) a& H* e5 U* o2 }- [
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
% F3 D# t( g. U" t9 ?& M& K#
+ C2 D d! I2 f# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
. l8 q. d1 g* H& P2 u# Problematic frame:0 [& {: U4 }3 I2 C
# C [javaswarm.dll+0xb8305]! B7 z$ o& t4 k! @
#2 N: x! S- f9 _" i
# An error report file with more information is saved as hs_err_pid1064.log |