{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Slides0204 - COP 3330 Slides 2/4 Topics Container Objects...

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

View Full Document Right Arrow Icon
Slides 2/4 COP 3330
Background image of page 1

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

View Full Document Right Arrow Icon
Topics Container Objects Example Inheritance basics
Background image of page 2
Example Create a calculator that acts on rational numbers
Background image of page 3

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

View Full Document Right Arrow Icon
Inheritance Basics Inheritance defines an is-a relationship Example - Every cat is a mammal - Every mammal is an animal - Every animal is a living organism
Background image of page 4
Inheritance Basics What about multiple inheritance? Example - Dogs are mammals - Dogs are pets Multiple inheritance can be confusing and a big hassle so Java disallows it (uses interfaces instead)
Background image of page 5

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

View Full Document Right Arrow Icon
The extends Keyword The extends keyword means that this class is a subclass of another class
Background image of page 6
Background image of page 7

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

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

{[ snackBarMessage ]}