CISC 124 Lecture Notes - Lecture 7: Abstract Data Type

56 views1 pages

Document Summary

Ex: would be an mammal class with subclasses of species. Can only use abstract methods in abstract classes. i. e. public abstract () Theses are just placeholders to be overriden, i. e. , they have no body. Interface - an absract class that contains only abstract methods, no data and no concrete methods (may also contain constants) Its like a skeleton or template for a class. Ex: a stack is an abstract data type. Operations include: push, pop, isempty with several ways to implement. To implement: for arraystack, which implements stack public class arraystack implements stack{ Must commit to a certain implementation because you cannot instansiate an abstract class. Recall: a class can extend only one other class. A class can implement multiple interfaces as long as there are no conflicts like if one interface gives an int method, and the other gives the same method, but as a string.

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