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實現(xiàn),但是在Eclipse要怎么辦才可以呢? 有人說在console里輸入,但是我試了一下,console是只讀的,不能打字。
添加回答
舉報
0/150
提交
取消