我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。( Q0 \/ B% v, {2 _
import swarm.Globals;6 i( N3 ?0 `2 w4 a9 U {
# H0 D* m2 Z1 \% N1 `+ e+ b; }' [
public class test { Z" s3 }1 [. T* _6 ?/ X
/**4 G7 L q9 j5 V2 M$ {7 W1 f4 w1 P
* @param args1 r( E5 `: @9 h% a( ]; T! R
*/. B! K% z& b+ j6 B6 Q1 s H! [
public static void main(String[] args) {6 C( S" ]3 P2 f" u6 H. A
2 ~( z, a c, U5 u* k6 r
int y=(int)(10*Math.random());, Y0 Y. w. s7 g4 D* U1 f
System.out.println("result is "+y);
" Z4 s8 ]" S" |% h& z& c# z9 d8 M0 @3 B1 A b1 p
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);9 e. P' y) W9 V
System.out.print(z+" re");/ ] i2 i8 F) ?2 c1 {3 j
}
% ^$ ?# T# w! W, X}
( t) s0 N( _$ U0 e6 i* z
+ |/ w# l9 f6 L1 C8 R结果是:5 [+ ^1 S' p. |& _# S
result is 2
/ U/ C- a; Q- P2 Y. F#
! S# {1 E+ M1 o2 f y# X# An unexpected error has been detected by Java Runtime Environment:
! u# w2 ~4 ~: x, g5 {#
* L: Z& A" R, c# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 j) q8 ~5 h M9 }! m( \+ N
#/ t" C* }6 {% b0 p3 K6 `: {% j
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)9 l( [0 m6 f) ?) x# p% d4 h
# Problematic frame:# Q4 L+ U% J8 Y" t% |% V) V
# C [javaswarm.dll+0xb8305]
* e) Q8 T" U# b' j0 j+ k8 o4 E#
$ i$ E8 r3 P) @' s# b. \# An error report file with more information is saved as hs_err_pid1064.log |