我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。$ m( p( {0 p9 N9 b# r. C
import swarm.Globals;
+ p& u# H, S) R0 F h2 y6 e' J& ]; w) ^: y* M
public class test {) i# d4 r9 Y6 s
/**& S0 ? y8 x* Y5 A; w8 |
* @param args
# n, R0 M2 \. ?/ o1 k' h( W */* u3 L) |" ?* F0 h' \7 u/ h2 s+ R8 [
public static void main(String[] args) {' j' J+ n" Z& Q# t" A+ a
, u, n+ }( s9 S+ I6 h' _) x) b int y=(int)(10*Math.random());
% ~" {& j% o" s) A2 Y( g System.out.println("result is "+y);' ?/ v7 j$ W. x; f: S
4 W4 }8 m5 U F9 i3 Z
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
! p: x$ w$ }6 S8 ^; g+ g3 q System.out.print(z+" re");
, o, _# S. r* i/ [' Q }: O2 @7 s" {# m
}) X4 p- @# e$ {/ ^% I" L$ q# `
% v# F/ D+ Y5 s$ g' @6 }( j" j
结果是:
6 h2 i9 a! c" G v( G/ S+ ]result is 2
9 Z0 P0 l; T* O/ Z0 U% Q2 @#
0 p( S' m& s9 G% m8 c# An unexpected error has been detected by Java Runtime Environment:. d* V% |& S0 i2 w4 X
#
! e' B, z' ]1 S5 z( m4 K: `6 u6 s& m# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068# E' S2 ^& ?& y5 X. w9 g1 |
#
5 D0 ~8 f- n7 m V& |% H# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
2 \, @* |, ^1 s1 [% R; p2 K$ s# m5 m2 |# Problematic frame:
' Y# c1 \) f% K$ a. Y4 v# C [javaswarm.dll+0xb8305]/ r" w, J6 Y; i" T- Q0 O0 [
#
% X- ~, D" Z! J# An error report file with more information is saved as hs_err_pid1064.log |