Is there is any error if you have multiple main methods in
the same class?

Answer Posted / bindhu

The compilation error " main(lava.lang.String[]) is
already defined " will occur when we use have multiple main
methods in the same class?

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain an algorithm to find depth of a binary tree.

532


Can we sort hashset in java?

611


What is the hashcode () and equals () used for?

523


When will we use them?

578


what is inner class in java?

613






Explain the difference between abstract class and interface in java?

526


How to declare objects of a class ?

578


What is the default value of the local variables?

491


Can a class have 2 constructors?

488


What is java life cycle?

523


What if I write static public void instead of public static void in java?

565


Can an interface implement another interface?

555


What is re-factoring in software?

566


Can we have a method name same as class name in java?

567


What are the kinds of polymorphism?

598