Tuesday, April 28, 2009

Inheritance and Method Overriding

After a recap about classes and data types in Java we will expand our knowledge about object-oriented programming today.
Two important ideas we will be learning about are inheritance and method overriding.
Inheritance means that a new class, called a subclass, inherits all the attributes and all the methods of an existing class, called the superclass, and extends it with its own attributes and methods.
Java also allows to adapt and re-write the methods from the superclass in the subclass. We call this "method overriding". By this each object of the superclass can be of a specific subclass. In object-oriented programming this is known as polymorphism. Watch today's presentation.

Homework
Answer the review questions about classes in Java.

No comments: