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 nan in java?

775


What is heterogeneous in java?

735


What is difference between hashset and hashmap in java?

718


What’s the difference between constructors and other methods?

777


Which oo concept is achieved by using overloading and overriding?

788


What is Java Package and which package is imported by default?

845


Explain thread life cycle in java?

799


How to make a non daemon thread as daemon?

825


What are voids?

755


How do you define a method?

744


What are the important features of Java 9 release?

770


what is meant by encapsulation?

861


What is keyset in java?

855


What is 32 bit float?

781


What are some alternatives to inheritance?

844