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

How will you reverse a singly-link list?

934


What is class forname used for?

992


What do you know about the garbate collector?

975


Explain access modifiers in java.

967


What are register variables what are the advantages?

862


Explain an algorithm to find depth of a binary tree.

987


What is java regex?

938


What is math floor in java?

877


What is the meaning of variables in research?

974


Explain inner classes ?

1069


What is style and indentation?

952


What is java argument list?

878


What makes a function well defined?

935


What are static methods?

989


What do you mean by local class?

946