What happens when a main method is declared as private?

Answer Posted / maduakor ngozi chukwukodinaka

When a method is declared as private, the program compiles
properly but it will give runtime error ?Main method not
public".

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain abstract class in java?

552


Can we have a try block without catch block?

561


What is replacefirst in java?

562


Is double bigger than float?

538


What is the difference between declaration and definition in java?

515






What do you mean by append?

530


What best practices should you follow while writing multithreaded code in java?

535


When should you use arraylist and when should you use linkedlist?

486


How does linkedlist work in java?

503


What is wrapper class html?

524


Explain with example the concept of constant variable in java.

620


Is upper case in java?

525


Is 0 true or is 1 true?

514


What is the difference between @before and @beforeclass annotation?

528


What is the difference between multiple processes and multiple threads?

570