我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
2 `1 f$ G, x& H5 ^$ t+ oimport swarm.Globals;
/ X' h& |8 N" j. j- G/ O9 S! i8 |* d/ @8 \: i p
public class test {
. N+ C6 }8 S# G( b /**6 [' k+ V: L$ O5 h' \, E0 k
* @param args
, K% d( r( d8 E' `9 K1 `# A */) Z+ q6 ?+ e! P$ Z; b2 ?
public static void main(String[] args) {
+ y B- b+ F+ R, o9 K! H ) p; ]* s2 k# F Z2 r2 G8 n
int y=(int)(10*Math.random());, r# |7 Y& @$ s9 s0 C
System.out.println("result is "+y);. \. z* r& _' Z {
. t0 z+ g& K' C
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
! @: B n+ h P$ {, n8 v8 P System.out.print(z+" re");
$ U7 t9 \1 ]: W! T: j5 B5 b: q9 q0 ` }: n l1 Y8 E. C8 l! {
}$ l5 B- {5 L! O6 Z- N# |
8 i9 r4 Q" p2 N" j' E$ B) ~! f- e
结果是:
`" s8 i& H. q+ |& Tresult is 2
9 z. g `& N/ m5 F4 d) C! D- z#+ O/ g8 N# P, k' M d0 J$ |) r8 L
# An unexpected error has been detected by Java Runtime Environment:0 ?& }) I W- p5 `; A$ t- u
#' ?" {' i' c! b
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
2 Y& ^) n& |! r1 N! v#2 Q& o7 H' ?% r* t
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)2 V+ l9 h/ X9 o2 G& v% e
# Problematic frame:
! I$ P! e3 U6 p( t" v% W2 b, }# C [javaswarm.dll+0xb8305]
* \' @( D& h `' S( v" Y#
8 m2 ~, m) I; @: z' }# C, d; h# An error report file with more information is saved as hs_err_pid1064.log |