Professional Documents
Culture Documents
National University of Computer & Emerging Sciences
National University of Computer & Emerging Sciences
2.
3.
4.
For example, think of a superclass called Animal that has a method called animalSound().
Subclasses of Animals could be goat, Cats, Dogs, Birds - And they also have their own
implementation of an animal sound (the goat maaa, and the cat meows, etc.):
5.
Create an overloading function to add two number and three numbers.
Create an overriding function to add two number and three numbers.