nayeem
what is given output?
1 Answer(s)      4 years and 9 months ago
Posted in : Java Interview Questions

public class { public static void main(string argv[]) }.........?

Advertisement
View Answers

December 3, 2010 at 11:32 AM


Hi Friend,

It will give error as you haven't specify the class name through which the class is to be saved and compiled. Moreover there is a missing braces.

Anyways, the correct format is:

public class Hello{
    public static void main(String argv[]){
        System.out.println("Hello World");
    }
}

Thanks