Name newname thisaddress public personstring newname

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: ring newName) { = newName; this.address = ""; } public Person(String newName, String newAddress) { = newName; this.address = newAddress; } CS133 Course Notes Lecture 14, Slide 9 The Person class public String getName() { return; } public void setName(String newName) { = newName; } public boolean sameName(Person other) { return; } // Also getAddress and setAddress and // sameAddress CS133 Course Notes Lecture 14, Slide 10 9 10 Person as Superclass • Person is called the superclass (or base class or parent class). • This is the most general class. • From this class, subclasses (or derived classes or child classes) can inherit properties (e.g., methods and attributes) from the super class. CS133 Course Notes Lecture 14, Slide 11 Person continued • Using the University hierarchy again, we will creat...
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