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 is the generic class?

538


What is a local, member and a class variable?

582


How do you declare an array that will hold more than 64KB of data?

650


What’s a deadlock?

616


What is tostring () method?

552






What is a layout manager and what are different types of layout managers available in java awt?

733


Can we use a switch statement with strings?

557


Explain creating threads by extending thread class ?

586


What is the difference between call by reference and call by pointer?

511


What is advantage of java?

548


Explain the advantages of packages in java?

521


What is deserialization?

591


What is a heavyweight component?

548


What is assembly used for?

510


What are the differences between the constructors and methods?

592