CSE 8B Chapter Notes - Chapter 11.1-11.5: Hurricane Ioke

75 views2 pages

Document Summary

Object-oriented programming allows one to define new classes from existing ones: called inheritance. Inheritance: good tool for reusing software: best way to avoid redundancy and make system easy to understand. Inheritance: allows one to define a base class (superclasses) and extend it to more specific classes (subclasses) Class (c1) extended from another class (c2) is called the subclass, and c2 is the superclass: superclass == base class == parent class, subclass == extended class == child class. These classes inherit fields and methods from its parent, and can implement. Syntax for creating a subclass: new fields and methods as well: public class subclass extends superclass. Note: private variables declared in the super class can still only be used within that class. They can still be modified via getters/ setters still. Note: inheritance should model the is-a relationship. Note: in java, a class can inherit from only one super class.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents