Java Syntax Question 5

Question

What is the output of the following code?

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


String should be double quoted.

public void Main(String[] args) { 

should be

public static void main(String[] args) {

Note

Methods are contained in a class.

To run a Java program, the program must have a main method.

The main method is the entry point of an application.

Java source programs are case sensitive.




PreviousNext

Related