Home / Questions / 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 )
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,147 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

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 }.