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

Is space a char?

520


Write java program to reverse string without using api?

541


What is valid keyword in java?

545


What is the core java?

533


If a class is declared without any access modifiers, where can the class be accessed?

587






take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).

1527


If a method is declared as protected, where may the method be accessed?

519


What is visibility mode?

521


What is the difference between abstract class and interface1? What is an interface?

549


What is a values collection view ?

675


Explain what is Marker interface?

602


What is java virtual machine and how it is considered in context of java’s platform independent feature?

639


Can we write a class without main method in java?

473


Difference between serialization and deserialization in java?

644


What is temp in java?

539