Example co op student is more specific than student

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: – Example: Co-op Student is more specific than Student, which is more specific than Person. CS133 Course Notes Lecture 14, Slide 5 Observations continued • Attributes are passed down the tree – Example: if person has an address, then students will also have an address. • The CS/Java/O-O hierarchies will guarantee the above point – In “real life”, not all attributes are inherited CS133 Course Notes Lecture 14, Slide 6 5 6 How does this relate to CS? • We will treat these classes of things as objects, and relate them together using INHERITANCE Person • Suppose we know that all people have a name and an address. • We can do the following to the name and address: – Set – Compare – Retrieve CS133 Course Notes Lecture 14, Slide 7 CS133 Course Notes Lecture 14, Slide 8 7 8 The Person class public class Person { private String name; private String address; public Person(St...
View Full Document

This note was uploaded on 07/17/2010 for the course CS 133 taught by Professor Kierstead during the Fall '07 term at Waterloo.

Ask a homework question - tutors are online