✏️ Explanatory Question

Identify and fix the errors in the following code:

1 public class Welcome {
2 public void Main(String[] args) {
3 System.out.println('Welcome to Java!);
4 }
5 )

👁 3,148 Views
📘 Detailed Answer
💡

Answer with Explanation


Line 2. Main should be main. 
Line 2. static is missing.
Line 3: Welcome to Java! should be enclosed inside double quotation marks.
Line 5: The last ) should be }.