CSC 216 Lecture Notes - Lecture 6: Object Copying, Multiple Inheritance, Javadoc

55 views8 pages
6 Sep 2016
School
Course
Professor

Document Summary

Abstract class: a java class that cannot be instantiated, but instead serves as a superclass to hold common code and declare abstract behaviors. The most common use of abstract classes is when you want to have a superclass with common code to reduce redundancy, but actually having that parent instantiated wouldn"t make sense within the context of your code. Making a class abstract also prevents users from trying to instantiate it as a class, which is great if it was never built to be constructed as an object. Any class with abstract methods must be declared abstract in the class header: public abstract exampleclass { } Abstract classes can have constructors to initialize its state: concrete classes should call those constructors to maintain paradigm of one path of construction . You cannot create instances of class that are abstract! Remember how the name describes the class in that way!

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