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...

explain about method overloading and method overriding with
difficult examples

Answer Posted / suja

Overloading:
Method Overloading, allows the user to achieve the compile time polymorphism.Overloaded methods are always the part of the same class. These methods have the same name, but they may take different input parameters.The arguments passed to a overloaded method may differ in type or in number, or both.
Overloaded methods may have the same or different return types.
Overriding:
Method overriding in java means a subclass method overriding a super class method. Superclass method should be non-static. Subclass uses extends keyword to extend the super class. In the example class B is is the sub class and class A is the super class. In overriding methods of both subclass and superclass possess same signatures. Overriding is used in modifying the methods of the super class. In overriding return types and constructor parameters of methods should match .

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the file class in java programming?

1026


Explain the use of volatile field modifier?

1077


What is mvc in java?

1013


Is this valid in java ? Can we instantiate interface in java?

983


What is the vector class in java programming?

1085


What is == in java?

1016


What is a boolean field?

959


List types of storage classes in java?

1149


Write a program in java to find the maximum and minimum value node from a circular linked list.

1082


When would you use a static class?

984


What is native method in java?

1058


What is the use of generics? When was it added to the Java development Kit?

1019


What is method reference?

977


What is your platform’s default character encoding?

1082


Can you explain the usages of class.forname()?

1074