OOP Overview Flashcards
Five basic concepts of Object Oriented Design:
classes and objects,
inheritance,
interfaces and methods,
encapsulation,
polymorphism.
A Maple (capital M) is a _______. We capitalize it because it’s the blueprint. When seeds drop and sprout, the growing maple tree is really an __________, or a type, of the Maple class. The growing maple tree is considered an _________, that is, an instance of a class.
class, instance, object
________________ is a fancy word to describe the protection, or hiding, of data. The power of ____________________ is that you can protect certain data in certain classes from being used.
Encapsulation, objected-oriented design
An __________ of a Maple class (a maple) will change colors in the fall. To do so it needs a __________, or a function that performs an action.
instance, method
An ___________ tells the object what it can do. For example, it tells a tree that it can grow.
interface
_____________ really means that the same thing can have different features.
polymorphism
An object-oriented design consists of periodical and publication data. The hierarchy of classes, from top to bottom is as follows: Publication -> Book -> Novel. If the Novel class gains all methods and fields from the Book class, this is an example of which of the concepts of Object Oriented Design?
inheritance
A parent class called SoftDrink has a brew() method. RootBeer and Beer classes inherit from SoftDrink. Each uses the brew() method but in different ways. Which aspect of object-oriented design is this?
polymorphism
You are designing a program for payroll. The Tax class has a method to calculate tax rates based on pay. You want to keep this method and its variables invisible to other classes. They can access the method but don’t get to see its details. This is an example of _____.
Encapsulation
You are designing a program for vehicles. Some of the class names include Semi, Compact, and SUV. If we create a new semi, it is said that the semi is a(n) _____ of a(n) _____.
instance ; Semi class
You have designed a hierarchy of classes for accounting software. All parent/child class relationships are set. What will you need for the classes to actually perform tasks?
Methods
An ________ is a component of a program that knows how to perform certain actions and how to interact with other elements of the program.
object
____________________ is an approach to problem solving where all computations are carried out using objects.
OOP
A ______ is a blueprint of an object. You need to have a ________ before you can create an object. Objects have ________ and ___________.
class, class, methods, attributes
A _________ is a procedure associated with a class and defines the behavior of the objects that are created from the class.
method
A ____________ is a combination of instructions that are combined to achieve some result.
function
An object is ____________ when the class is invoked.
instantiated
the _____________, creates the new instance.
constructor
_____ means that classes can share the properties and methods from other classes
inheritance
create/instantiate a new instance of the Customer class?
Customer name = new Customer();
The line of code that creates an object from the class is called a _____
constructor
Information can be _____ in a Java class, meaning available only to that class
Encapsulated
An object is a(n) _____ of a class
instance
A Java _______ is a representation of an entity and an implementation of its behaviors.
object