What happens when a main method is declared as private?

Answer Posted / milanjeet singh

When we define main method as private, it will compile but when run, it show an Error as: main method is not found in the class, please define the main method as public static void main (String[] args)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which command from the jdk compiles a java program?

477


How will you reverse a singly-link list?

588


Can you use abstract and final both with a method?

569


Difference between collection, collection and collections in java?

564


How can we pass argument to a function by reference instead of pass by value?

579






What are the two types of java programming?

530


Write a program to find the whether a number is an Armstrong number or not?

569


What is the purpose of the runtime class in java programming?

553


Can we have two methods in a class with the same name?

576


Can set contain duplicates?

538


what is meant wrapper classes?

594


Can I overload to string method

960


How do you sort in descending order in java using collections sort?

486


Explain the importance of finally over return statement?

600


what is encapsulation in java? Explain

657