OOPS Interview Questions with Answers for Freshers

What is OOPS?
OOPS is abbreviated as an Object-Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.
Write basic concepts of OOPS?
The following are the concepts of OOPS and are as follows:.
What is a class?
A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describes the details of an object.
What is an object?
The object is termed as an instance of a class, and it has its own state, behavior, and identity.
What is Encapsulation?
Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden data can be restricted to the members of that class.
Levels are Public, Protected, Private, Internal and Protected Internal.
What is Polymorphism?
Polymorphism is nothing but assigning behavior or value in a subclass to something that was already declared in the main class. Simply, polymorphism takes more than one form.
What is Inheritance?
Inheritance is a concept where one class shares the structure and behavior defined in another class. Inheritance applied to one class is called Single Inheritance, and if it depends on multiple classes, then it is called multiple Inheritance.
What are manipulators?
Manipulators are the functions that can be used in conjunction with the insertion (<<) and extraction (>>) operators on an object. Examples are endless and site.
Define a constructor?
A constructor is a method used to initialize the state of an object, and it gets invoked at the time of object creation. Rules constructor are:
Constructor Name should be same class name.
The constructor must have no return type.
Define Destructor?
Destructor is a method that is automatically called when the object is made of scope or destroyed. Destructor name is also the same as class name but with the tilde symbol before the name.

Leave a Reply