What happens when a main method is declared as private?

Answer Posted / harsha

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 ?    111 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to persist data of objects for later use. What’s the best approach to do so?

497


What is io stream in java?

507


What does next mean in java?

525


Is vector synchronized in java?

543


FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

2620






What is difference between word and integer?

584


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1010


How to access arraylist elements in java?

482


What is the history of java?

532


What exactly is java?

500


What is treemap in java?

540


What are keywords in programming?

555


What is the difference between throw and throws keywords?

562


What is difference between printf and scanf?

505


Can a class declared as private be accessed outside it’s package?

501