Object Concepts and Terminology-2

Tostring author author n

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: package and by inheritance Available within the current package A subclass can always access the public and protected members of its parent class, someDmes package, but not private members. Superclasses, Subclasses, and Polymorphism CreaDng a Superclass (Parent) public Product( ) { private String code, name, descripDon; Product( ) { code, name, descripDon = “”; } public String toString( ) { return = “Name: “ + name + “\n” + “DescripDon: “ + descripDon + “\n”; } } Superclasses, Subclasses, and Polymorphism CreaDng a Subclass (Child) public Book(...
View Full Document

This note was uploaded on 03/08/2014 for the course CIS 304 taught by Professor Verbrugge during the Spring '08 term at Cal Poly Pomona.

Ask a homework question - tutors are online