Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / aburar yaseen

we can use multiple main methods in a class by overloading
and not by the overriding. but the overriding is possible
in case of parent child combination.

example:
class xxx{

public static void main(String args[]){}
void main(){}
}
the above is called overloading.

example2;
class xxx{
public static void main(String args[]){}
}
class yyy extends xxx{
public static void main(String args[]){}
}
the above is overriding.
example3;
class xxx{
public static void main(String args[]){}
public static void main(String args[]){}
}
the example3 is not possible
}

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is externalizable interface?

1092


How variables are stored in memory?

995


What is serialization in java?

1052


What are the characteristics of Final,Finally and Finalize keywords.

1169


How do you check if a character in a string is a digit or letter?

1062


Is it possible to compare various strings with the help of == operator?

983


Can an interface have a class?

998


Define Multiprogramming and Multiprocessing in java.

1133


What is native code?

1106


What is difference between length and length() method in java ?

989


What is the purpose of abstract class?

1010


What is join () in java?

961


Define an applet in java?

1144


What is the difference between exception and error in java?

1006


What is a "pure virtual" member function?

1087