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

What should I import for arraylist in java?

765


What is size of int in java?

813


What does percent mean in java?

805


Why hashset is used in java?

770


What are different types of expressions?

766


What is a heavyweight component?

771


What is the purpose of garbage collection in java? When is it used?

828


How to perform linear search in java?

763


Give me example of derived data types.

860


What is the difference between stored procedure & function?

770


Why does java not allow multiple public classes in a java file ?

3969


How can we make sure main() is the last thread to finish in java program?

950


What is java command?

804


How do you know if a value is nan?

815


Is class is a data type?

816