if(args[0].equals("lower")){
while(Math.random()!=0.0)
;
------------------------------^ 你这个分号把它去掉
System.out.println("Produced 0.0!");
}
else if(args[0].equals("upper")){
while(Math.random()!=1.0)
;
---------------------------------------^ 你这个分号把它去掉
System.out.println("Produce 1.0!");
}
while(Math.random()!=0.0)
;
------------------------------^ 你这个分号把它去掉
System.out.println("Produced 0.0!");
}
else if(args[0].equals("upper")){
while(Math.random()!=1.0)
;
---------------------------------------^ 你这个分号把它去掉
System.out.println("Produce 1.0!");
}
Usage:
RandomBounds lower
RandomBounds upper
再命令行下、jawabeginner下和jcreator下皆没问题!