What happens when a main method is declared as private?

Answer Posted / srinivasa

JVM is also a program. If main() is declared as privateit
is not available outside of that class . So JVM through the
exception.

Is This Answer Correct ?    15 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the basics of core java?

759


What is return used for in java?

735


What is the difference between compile-time polymorphism and runtime polymorphism?

774


What is the SimpleTimeZone class?

2010


Highest level event class of the event-delegation model?

3708


What is difference between next () and nextline () in java?

763


Differentiate between array list and vector in java.

869


What is hotjava?

743


What are the differences between processes and threads?

757


Explain the use of volatile field modifier?

855


Explain the difference between jvm and jre?

787


Realized?

1909


What is java used for?

777


What is string manipulation?

715


How do you reverse sort in java?

724