Top / Docs / 練習問題 / 解答例 / ループ練習2 / JAVA
public class Hellows {
	public static void main(String[] args) {
		try {
			int j = Integer.parseInt(args[0]);
			for (int i = 0; i < j; i++) {
				System.out.println("Hello World! " + (i+1));
			}
		} catch (ArrayIndexOutOfBoundsException e) {
			System.out.println(" java Hellows 1 のように実行してください");	
		}
	}
}
📝 このページに誤りを見つけたら…  GitHubで報告(エンジニア向け)  ・  フォームで報告