What happens when a main method is declared as private?

Answer Posted / yogesh gandhi

Wrong Vani.

The output of the program is

C:\>javac abc.java

C:\>java abc
Main method not public.

Is This Answer Correct ?    72 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if we override private method?

516


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

621


Can you extend main method in java?

607


Why do we override tostring method in java?

486


What is object data type?

549






Is minecraft 1.15 out?

538


What is a method vs function?

541


Define how can we find the actual size of an object on the heap?

642


Can we declare the static variables and methods in an abstract class?

538


What is the static block?

577


How do you make a thread in java?

621


What is the difference between and ?

496


How do you clear an arraylist in java?

485


What is stream api in java8?

522


What is the use of protected in java?

521