Quiz #1 Flashcards
Definition: Determining the set of features (properties and methods) that a class will have.
Abstraction
What are the two main properties of an object?
- Properties (data/variables)
2. Methods
Everything in Java is an object, except:
Primitive data types
Definition: The collection of code that contains the instructions for building an object.
Class
What are the three pillars of object oriented programming?
- Encapsulation
- Inheritance
- Polymorphism
Which concept of OOP deals with visibility modifiers and access to data and methods of a class?
Encapsulation
Basic idea of encapsulation:
Being able to control access to an object’s properties and methods
Which concept of OOP deals with the extension of classes?
Inheritance
Basic idea of inheritance:
A sub-class (child class) can inherit methods from its super class (parent class)
Every class in Java inherits methods and properties from what class?
Object Class
Which concept of OOP deals with method over-riding?
Polymorphism
What are two other ways to say polymorphism?
- Late binding
2. Dynamic binding
What is the difference between method overloading and method over-riding?
Method over-riding involves creating methods of the same name in DIFFERENT classes of the same hierarchy.
What is like a blueprint, or recipe in OOP?
Classes
What is an instance of a class?
An Object
What is an object?
A named instance of a class held in memory, consisting of methods and properties.
What is the state of an object?
The values held in it’s data variables
What is known as an object’s behaviour?
It’s Methods.
What does UML stand for?
Unified Modeling Language
UML: What does an italicized name mean?
Abstract
UML: What do the +, -, and # mean
+ == public
- == private
# == protected
UML: What does an underline mean?
Static
If you don’t specify an access modifier, what visibility does it have?
Default visibility: Only classes in the same package can view it.
What is a constructor method?
A constructor method is the method used to instantiate an object in memory.
What are the two ways that constructor methods are different from all other methods?
- Begins with an uppercase (because it’s named the same as the class)
- no return type is ever specified.
How do we make an object if we don’t write a constructor method?
Java provides one to us, called the default constructor
What happens once we define our own constructor methods?
The default constructor is no longer available.
What is a static method?
A class method, means that an object does not need to be made to use the method.
What is an object method called?
Instance Method