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

What is the Difference between Overriding and overloading?

Answer Posted / deepika singh

OVERLOADING:- 1) overloaded methods have the same name but
different parameter list.
2)a subclass method can overload a superclass method

eg:-int add(int a, int b)
int add(float a , float b)
are overloaded methods



OVERRIDING:-
it just in inheritance and the overriding
method must hold the same name and the same signatures .
the change maybe just in behavior .


The Cat class in the following example is the subclass and
the Animal class is the superclass. The Cat class overrides
eat() method inherited from Animal class.

public class Animal {

public void eat() {
System.out.println("Eat for Animal");
}
}

public class Cat extends Animal {

public void eat() {
System.out.println("Eat for Cat");
}
}

Is This Answer Correct ?    62 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between c# and visual basic.net?

1108


what's ArrayList in .Net (VB.Net or C#).What's the advantageous using ArrayList.

1097


How to run a dos command in vb.net?

1088


What are the types of generations in garbage collector?

1033


Explain the use of console application?

1007


Explain strong name in .net assembly?

1039


What are the difference between dispose(), close(), exit(), end()? When do we use them?

1080


What is the top .net class that everything is derived from?

1113


What is the purpose of objects present in asp.net?

1098


What is deep copy?

992


Explain the difference between vb 6 and vb.net?

1045


Explain the difference between thread and process?

1067


How many classes a dll can contain?

1037


Explain private assembly?

988


Explain about the keyword must inherit?

1040