我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
5 |: I7 Z# {- Fimport swarm.Globals;/ a$ y3 y( m# r) ]% t! x$ r
* b% [( i" K1 B
public class test {
* t C- O$ G( ?$ G0 b /**
" R3 ?' R& r3 X! O/ y" Q6 I * @param args, p! r. d: o1 g
*/
" T: S6 G2 I H% n1 @ public static void main(String[] args) {
! V U* W& H/ p7 I" ?) ]' {
7 l5 Z% z* h# q" E* s: W- C int y=(int)(10*Math.random());
3 j) ?( N% L1 S System.out.println("result is "+y);
2 X4 g9 L, ~2 _8 p E
1 }& z+ M3 d0 s% | double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);4 o! s! _2 F, y. ]/ a _
System.out.print(z+" re");
% P, i! L3 s8 H! T }3 x: H# a& N9 ], Q; d, V8 i
}/ Z! t# ~* y2 T" k1 A$ m
8 k4 w6 R3 }9 ~
结果是:2 @2 s0 l' e: P% h, e/ q% X/ u( U% P
result is 2
. l. D+ S/ t6 y- F$ A9 S#* g/ z' u r8 i1 k7 ?9 z. ]
# An unexpected error has been detected by Java Runtime Environment:
5 Y r8 L5 w: q7 [5 x: P## d6 W- V: e$ y1 ?' r
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
; N* H/ N& o6 R6 @, \ }4 q$ {#
* q- g- I. |, T# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
2 O) g/ b1 @" F! O; d# Problematic frame:: Z, H& Y' B2 b0 f8 |2 p$ w$ Z d
# C [javaswarm.dll+0xb8305]
& {/ Q z+ x3 E, } V#5 g% m# x/ l1 U3 I! W
# An error report file with more information is saved as hs_err_pid1064.log |