What happens when a main method is declared as private?
Answer Posted / dharma
main method signature must be like
public static void main(String args[])
if we declare as private then it compiles successfully
but at Runtime it says
"Main method not found in class"
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is object class in java?
What is a variable analysis?
What is the basic difference between string and stringbuffer object?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
Which sorting is used in arrays sort in java?
What is %d in printf?
Explain java code for recursive solution's base case?
what do you mean by classloader in java?
Explain about data types?
Explain the difference between string, stringbuffer and stringbuilder in java?
What is the difference between class forname and new?
What is the generic function?
What are the differences between throw and throws?
What is the difference between preemptive scheduling and time slicing in java programming?
Differentiate between vector and array list.