Interview Questions on Object-Oriented Programming.
What is an Object-Oriented Programming?
It is a method of organizing a program by Binding related properties and behaviors together into an individual object.
Which are main feathers of opps?
1. Inheritance
2. Abstraction
3. Encapsulation
4. Polymorphism
Why use opps in programming?
1) It provides a mechanism for hiding data through Encapsulation.
2) Code Reusability through Inheritance.
3) It offers flexibility through Polymorphism
4) Hiding Implementation details through Abstraction.
What is a class?
Class is a logical entity which is called as a blue print of an object. It is used to bind methods and variables together.
What is an Object?
Object is a physical entity. When an object is created using class then it gets memory into RAM?
What is an Instance Variable?
Instance variables are declared into a class. when object is created, instance variables are created.
What is Static Variables?
There would only be one copy of the static variable per class. it is shared between the objects. when program execution starts, instance variables are created.
What is a constructor?
A constructor is a special method that is used for initializing the instance variables of objects. They have the same name as the class.
What is a destructor?
A destructor is a method that is automatically invoked to deallocate the object.
What is polymorphism?
Poly means multiple forms so We can define multiple methods with the same names. There are two types of polymorphism Run-time and compile-time polymorphism. Run-time polymorphism implemented by method over-ridding and compile-time polymorphism implemented by method-overloading.
What is a method overriding?
Method overriding allows the child class to use methods of the parent class with the same name with the same signature means the method name, arguments, and return types remain the same.
What is method overloading?
Method overriding allows the class to create multiple methods with the same name but the different signature means the method name, arguments, and return types remain different.
What is Abstraction?
Abstraction means displaying only essential information and hiding the details. It refers to providing only essential information about the data to the user but hiding the backend details or implementation.
What is Encapsulation?
It describes the idea of bundling data and methods together as a single unit, called class. It is used to hiding data from the outside world using access specifiers.
What is An Inheritance?
Inheritance is the procedure in which one class inherits the attributes and methods of another class. The class whose properties and methods are inherited is known as the Parent class. And the class that inherits the properties from the parent class is the Child class.
Comments
common interview questions on c programming with answers.
Creating simple Python Snake Game code using Pygame
interview questions on data structures with answers.
TCS NQT frequently asked Coding Questions and Answers.