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
Is char * a string?
What is bigger kb or mb?
Can It is possible to synchronize the constructor of a Java Class?
Why main function is static?
how to create daemon thread in java?
Explain the access modifiers for a class, method and variables?
What is ellipsis in java?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
Can we have more than one package statement in the source file?
What is the char data type?
Name some OOPS Concepts in Java?
What is the Scope of Static Variable?
What are the 4 versions of java?
What does compareto () do in java?
What is the use of string and stringbuffer?