Top 50+ OOPS Concepts Interview Questions and Answers - 1
Question: 1
What are the OOPS concepts?
Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.
Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.
Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods"; this means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compilers job to select the specific action (that is, method) as it applies to each situation.
Question: 2
What is an Object? What is Object Oriented Programming?
Object represents/resembles a Physical/real entity.
An object is simply something you can give a name.
Object Oriented Programming is a Style of programming that represents a program as a system of objects and enables code-reuse.
Question: 3
What is a class?
Class is concrete representation of an entity.
It represents a group of objects, which hold similar attributes and behavior.
It provides Abstraction and Encapsulations.
Question: 4
What is Inheritance?
It is a process of acquiring attributes and behaviors from another object (normally a class or interface).
Question: 5
What is static constructor?
When constructors are used to set the value of a type’s data at the time of construction, if we want the value of such static data is to be preserved regardless of how many objects of the type are created, we have to define the constructor with static keyword.
Computer Awareness Questions for NIMCET, JNU, BHU, MCA More
Objective Computer Awareness Notes for Bank, Competitive Exams More
Boolean Algebra Questions and Answers Pdf Class 11 More
Spreadsheet Questions and Answers Pdf More
Computer Awareness Question Bank Pdf Free Download More
1000+ Electrical Machines Multiple Choice Questions and Answers Pdf More
Top 1000+ General English Questions and Answers Pdf More
Direct and Indirect Speech Questions for SSC CGL, CHSL Tier 1, 2 Pdf More
Samacheer Kalvi 9th Social Science Classical World Questions More
1000+ TNPSC Aptitude Questions with Solutions More