What happens when a main method is declared as private?

Answer Posted / thiru

The default signature should not be altered. If any changes, at run time "Class xxx does not have main method" exception will be thrown. But compilation will not give any exception.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is floor in java?

550


What are the main features of java?

523


Explain throw keyword in java?

603


Explain an algorithm to find depth of a binary tree.

538


Explain about transient variables in java?

634






Explain the differences between abstraction and encapsulation?

509


Write a function for palindrome and factorial and explain?

646


Difference between vector and arraylist.

572


Explain the public class modifier?

494


What is the use of static methods?

579


Is a case study a method or methodology?

456


Explain the importance of finalize() method.

558


How to do a true java ping from windows?

610


How do I compare two strings in word in java?

530


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

685