CSCI 1111 Final: FInal Exam Study Guide

112 views2 pages
26 Jan 2017
School
Course

Document Summary

Inheritance: classes can be derived from other classes, thereby inheriting fields and methods from those classes: definitions, a class that is derived from another class is called a subclass (also child class). When you want to create a new class and there is already a class that includes some of the code that you want, you can derive your new class from the existing class. In doing this, you can reuse the fields and methods of the existing class without having to write them. A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited by subclasses, but the constructor of the superclass can be invoked from the subclass. A subclass does not inherit the private members of its parent class, however public and protected fields can be used by the subclass. Casting objects: object is the data type of the class from which it was instantiated.

Get access

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

Related Documents

Related Questions