我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% F( K' g: F7 ?( h% \import swarm.Globals;# E+ i4 ?' d4 ^% P* z1 g
. L7 p! T, { B3 `% X& ^" |7 S& Xpublic class test {
; L/ {2 `* _9 ]8 v% }" s /**
9 ]) {. a3 o! \8 G6 h, _) t( F* a7 b * @param args
/ s# O: `4 O/ n2 E */
' R7 l" R8 J7 a8 E( v' {0 X/ x public static void main(String[] args) {
" p& p# n+ V9 y7 h6 M! X
: r$ t3 g2 a; L) R3 r% S% I$ V; V int y=(int)(10*Math.random());
: d/ e% S. N3 N! h( {6 A System.out.println("result is "+y);
5 E# t) J' b/ C) r
! c/ N$ X' G/ O d double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);5 ^7 y5 i% }- d- `1 ?$ j
System.out.print(z+" re");
! R- ~: f! A/ ?1 t }
6 C( `, ]' v* e3 i}
9 n1 C' ]0 b& u
0 z( M, u$ _; Z9 F) T结果是:. G. {0 B8 x) K5 Z6 P% c
result is 2
. I, Y5 T ^) e# V0 K. m# P#
9 o- J# ~( V' U2 ~# An unexpected error has been detected by Java Runtime Environment:
9 U" ~4 [( }# D4 C$ |#
$ l4 I1 y, R1 F- v) M# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10689 i1 H* j. ~; m3 N, `
#
$ ?* Y# R9 H% B8 T& _. _# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)9 n n$ Z8 A) Q, \$ Z$ Y9 W
# Problematic frame:4 h" p. Q+ V A, [! `/ I( ^
# C [javaswarm.dll+0xb8305]
" X9 S8 g; ]- N& V/ y: @, W G#2 C# }6 W5 A7 u
# An error report file with more information is saved as hs_err_pid1064.log |