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 are mutable classes?
What is the use of a copy constructor?
What is the difference between a scrollbar and a scrollpane?
What is variable and its types?
Why java is said to be pass-by-value ?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What is another word for methodology?
What is the r character?
Give me example of derived data types.
Implementations of set interface?
What is the method in java?
Difference between method overloading and overriding.
What is try-with-resources in java?
Explain the difference between comparator and comparable in java?
Can sleep() method causes another thread to sleep?