0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

引っ掛け問題-java

Last updated at Posted at 2019-10-09

引っ掛かった数だけ更新

sample
	        public class Sample {
	        public static void main(String args) {
	        int i = 10;
	        double d = 3.14;
	        boolean b = true;
	        System.out.print(i + " " + d + " " + b);
	    }
	}

10 3.14 trueが表示されるかと思いきや実行時に起動エラー。
エラーメッセージ:エディターにはメイン型が含まれていません。

mainメソッドの引数の表記が正しくない []

sample
	        public static void main(String args) //正しくない
	        public static void main(String[] args) //正しい

文法的には正しいのでコンパイルは通ってしまう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?