CSC207H1 Lecture Notes - Instance Variable

47 views2 pages
11 Jan 2013
School
Course
Professor

Document Summary

Types, now that we know inheritance and interfaces: a class child that extends class parent and implements interface person Can be used anywhere that parent is legal. Can be used anywhere that interface is legal. But cannot be replaced by an object of type parent. A class can only extend one parent, but can implement many interfaces. Implements is a way to guarantee a capability. A set of methods that implement some functionality. Casting: an instance of a class child has. A child part, with all the data members and methods of child. A parent part, with all the data members and methods of parent. A grandparent part, etc. , all the way up to object: casting can be used to access the different parts, need to cast down but not up. When java looks up a name, it automatically will look up through the parts of an object if necessary.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions