Week 08 - Constructors, Class Hierarchy, Design

Of inheritance class a public base publicint is

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: ivate: int private_int; }; Access specifiers Types of inheritance class A : public Base { // public_int is public // protected_int is protected // private_int is inaccessible }; class B : protected Base { // public_int is protected // protected_int is protected // private_int is inaccessible }; class C : private Base { // public_int is private // protected_int is private // private_int is inaccessible } Class Hierarchy ● Good modeling habits ○ "is a" rule ○ "extends" rule ○ Example: ■ class Animal class Tiger : Animal ■ Tiger is an Animal ■ Tiger ex...
View Full Document

Ask a homework question - tutors are online