Exam 1 Flashcards
Abstraction
Provide high-level model of activity or data
Don’t worry about the details; What does it do, not how
Procedural Abstraction
Specify what actions should be performed
Hide algorithms
Data Abstraction
Specify data objects for problem
Hide Representation
Abstract Data Type (ADT)
Implementation independent of interfaces
Encapsulation
A design technique that calls for hiding implementation details while providing an interface (methods) for data access
Allows us to code without having to know its implementation
Change the internals all you want, but just keep the interface constant
Interfaces
Allows us to express an ADT
Provides abstract methods
Defines an IS-A relationship
Class
Blueprint for an object
a.compareTo(b) returns?
Negative if a < b
0 if a == b
Positive if a > b
Inheritance
The process by which one new class, called the derived class (subclass/child class), is created from another class, called the base class (superclass/parent class)
extends
Specifies that a class is a derived class of another class
super()
refers to the parent class object calls the constructor of the parent class Must be the first line in the child class' constructor
Overriding
A derived class redefines existing methods of the parent class
Overloading
When two or more methods have the same name but different parameters
this
refers to the current object
Protected
a class element that is only accessible to any derived class or any class in the same package