Abstract Classes and Polymorphism. ? Classes in a hierarchy are related by the is-a relationship. For example a Nissan is-a.
Sample class diagram representing inheritance & polymorphism. 6. Interface and Abstract Class. • Why do we need abstract classes? Abstract vs concrete class
Polymorphism. • Interface and Abstract Class. • Quiz 2. • Generic and Review. • Introduction to Java Programming. • Wrapper Class Arithmetic Operation
Oct 3 2011 G. Lipari (Scuola Superiore Sant'Anna). Introduction to Java. October 3
Example. PolymorphismDemo.java (Liang pp. 311-312). Student. Person. Object. GraduateStudent run time for objects that belong to the abstract class.
Introducing the concept of polymorphism. ? Learning how to use interfaces and abstract classes in Java. ? Introducing the comparable java interface.
In Java polymorphism is the ability of an object to take on many forms An abstract class provides a superclass from which other classes can.
INHERITANCE and POLYMORPHISM cannot instantiate a abstract class ... Example: Student.java class Student implements Comparable.
Apr 10 2008 To introduce the notions of abstract methods
class – object encapsulation