Object-Oriented Programming Flashcards
(97 cards)
a methodology or paradigm to design a program using classes and objects
Object-Oriented Programming
Any entity that has state and behavior is known as an ?
object
A _________ is a template that is used to create objects, and to define object data types and methods. Core properties include the data types and methods that may be used by the object
class
A ________can also be defined as a blueprint from which you can create an individual object. _______ doesn’t consume any space.
class
Advantages of OOPs over Procedure Oriented Programming
- Makes development and maintenance easier as the code increases in size.
- provides data hiding, wheres with POP data is stored globally
A _____is a blueprint from which individual objects are created.
class
a ___________is a block of codes similar to the method. It is called when an instance of the object is created, and memory is allocated for the object.
It is a special type of method which is used to initialize the object.
constructor
Rules to remember while creating a constructor
- Constructor name must be the same as its class name
- A Constructor must have no explicit return type
- A Java constructor cannot be abstract, static, final, and synchronized
Two Types of Constructors
- Default
- Parameterized
The __________constructor is a no-args constructor that the Java compiler inserts on your behalf
default
A constructor which has a specific number of parameters is called a ____________constructor.
parameterized
The _______________constructor is used to provide different values to the distinct objects.
parameterized
A ___________is used to initialize the state of an object.
constructor
______________________ in Java is a technique of having more than one constructor with different parameter lists. They are arranged in a way that each constructor performs a different task. They are differentiated by the compiler by the number of parameters in the list and their types.
Constructor overloading
A _____________is used to expose the behavior of an object.
method
A ___________ must not have a return type.
constructor
The ___________is invoked implicitly.
constructor
A _________must have a return type.
method
The Java compiler provides a _____________ if you don’t have any constructor in a class
default constructor
The __________is invoked explicitly.
method
The ________ is not provided by the compiler in any case.
method
The _____________ name must be same as the class name.
constructor
The _____________ name may or may not be same as class name.
method
The Four Pillars of OOP
- Inheritance
- Polymorphism
- Encapsulation
- Abstraction