class NewRoot { public static void main(String[] arguments) { int number = 100; String count = "25"; float sentence = 17.5F; if(arguments.length > 0) { number = Integer.parseInt(arguments[0]); } System.out.println("The square root of " + number + " is " +Math.sqrt(number)); System.out.println(Math.sqrt(Integer.parseInt(count))); System.out.println("My sentence has been reduced to " + sentence + " years."); } } 像这样的输入arguments[0],就可以改变输出值,在dos里可以输入java NewRoot 200实现,但是在Eclipse要怎么办才可以呢? 有人说在console里输入,但是我试了一下,console是只读的,不能打字。
1 回答
- 1 回答
- 0 关注
- 713 浏览
添加回答
举报
0/150
提交
取消