Is there is any error if you have multiple main methods in
the same class?
Answer Posted / srikanth
No, there is no error if we have multiple main methods
in the same class.
because, while compiling we only specify one main method
name so, the JVM compiles it by taking the main method which
is specified by us while compiling.
Is This Answer Correct ? | 3 Yes | 23 No |
Post New Answer View All Answers
What is blank final variable?
What is array and arraylist in java?
What is the difference between char and char *?
What is an escape character in java?
Can private class be extended java?
How is garbage collection controlled?
Why is stringbuffer thread safe?
Can a function return a function?
Write a function for palindrome and factorial and explain?
What is hashmap in java?
How many bytes are there?
Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?
What is the difference between class forname and new?
What is the difference between replace and replace all?
What are autoboxing and unboxing? When does it occur?