Common Mistakes Java Beginners Makes

java dev.to

✔️ Correct Code : public class Home{ public static void main (String[] args){ System.out.println("hello world"); } } ❌ 1. Class name and file name don’t match. public class home{} my actual file name is Home.java, above the code class name is home. File name must be Home.java Otherwise you will get a compile error OUTPUT ERROR: ❌ 2. Wrong main method syntax public static void main (String{} args){ } ✔️ What is String[] args? It is an array of s

Read Full Tutorial open_in_new
arrow_back Back to Tutorials