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

Can a boolean be null java?

535


What is Java Shutdown Hook?

606


How to overcome the exception object reference not set to an instance of object?

616


How do you create immutable object in java?

535


What is port number in java?

585






What is string example?

593


How to create a thread in java?

596


What do you mean by access modifier?

550


What is difference between array and arraylist in java?

456


What is instance synchronization?

536


how to create constants in java?

597


Explain about class in java?

608


What are meta-annotations?

547


Can you start a thread twice in Java?

627


Why is string builder not thread safe?

587