Ch4-2 - EE322C DataStructures Chapter4:Inheritance...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Ramesh Yerraballi 4-1 EE 322C Data Structures Chapter 4:Inheritance (Part 2/2)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Ramesh Yerraballi 4-2 Design Hierarchies We will discuss the  hierarchy of shapes as an  polymorphism/ inheritance   example Circle Shape Rectangle Square
Background image of page 2
Ramesh Yerraballi 4-3 abstract  methods and classes No abstract: public class Shape { public double area() { return -1; } } With abstract: public abstract class Shape { public abstract double area(); } Abstract methods/classes  represent placeholders An abstract method declares  functionality that all derived  classes must eventually  implement. So, it says  what  an  object can do, leaving the  derived class to provide the  implementation  ( how  it is  done) A class with at least one  abstract method must be an  abstract class
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Ramesh Yerraballi 4-4 Multiple Inheritance Java does NOT support multiple  inheritance StudentEmployee inherits from both the  Student class and the Employee class.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/26/2009 for the course EE 322C taught by Professor Nettles during the Spring '08 term at University of Texas.

Page1 / 8

Ch4-2 - EE322C DataStructures Chapter4:Inheritance...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online