Top OOPs Interview Questions For 2022

Arth Jani
2 min readJan 9, 2022

Q1) What is Object Oriented Programming?

Object-Oriented Programming(OOPs) is a type of programming that is based on objects rather than just functions and procedures. Individual objects are grouped into classes. OOPs implements real-world entities like inheritance, polymorphism, hiding, etc into programming. It also allows binding data and code together.

Q2) What are the main features of OOPs?

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Data Abstraction

Q3) What is the difference between a class and a structure?

  • Class: User-defined blueprint from which objects are created. It consists of methods or set of instructions that are to be performed on the objects.
  • Structure: A structure is basically a user-defined collection of variables which are of different data types.

Q4) What is the difference between a class and an object?

  • Single inheritance
  • Multiple inheritance
  • Multilevel inheritance
  • Hierarchical inheritance
  • Hybrid inheritance

Q5) What is inheritance?

Inheritance is a feature of OOPs which allows classes inherit common properties from other classes. For example, if there is a class such as ‘vehicle’, other classes like ‘car’, ‘bike’, etc can inherit common properties from the vehicle class. This property helps you get rid of redundant code thereby reducing the overall size of the code.

Q6) What is polymorphism?

Polymorphism refers to the ability to exist in multiple forms. Multiple definitions can be given to a single interface. For example, if you have a class named Vehicle, it can have a method named speed but you cannot define it because different vehicles have different speed. This method will be defined in the subclasses with different definitions for different vehicles.

Q7) What is method overloading?

Method overloading is a feature of OOPs which makes it possible to give the same name to more than one methods within a class if the arguments passed differ.

For More Checkout OOPs

And CheckOut AJ Blogs Programming for more Programming Related Content.

Originally published at https://ajblogsprogramming.blogspot.com on January 9, 2022.

--

--