In oop, which of these helps the compiler process objects differently based on their data type or class? Inheritance polymorphism abstraction encapsulation
Answers
Answer: inheritance
Explanation:
In object oriented programing OOP, the compiler process objects on a different basis depending on their class they belong to. OOP concept of the programming language is something that is widely used method of the programming language
In OOP there are objects and classes, classes are the basically nothing but a blueprint of the object, and objects are the instances of objects. When the new objects are created that allows the design of that object to depend on the class it belongs to.
Encapsulation makes and maintains the methods and procedures of the class as a single entity and encloses it in a single module.
Abstraction focuses on data hiding, it keeps the data intact as a private substance. Not revealed to outside world or user.
Polymorphism is an ability of an object to present itself in multiple forms. This is mainly visible via constructor or function overloading or overriding.
Inheritance is the procedure of deriving features such as method and data members from parent classes. This is broadly determined depending upon mode of inheritance that's public or private. This is basically sharing of member function or methods from parent classes. Hence the compiler treats objects differently based on their data type or class wheather it belongs to parent or child classes.
Answer:
Inheritance.
Explanation:
The compiler process objects differently on the basis of the class they belong. In Object oriented programming the following things are included and they play a major role in the decision making of the compiler.
In OOP there are objects and classes, classes are the blueprints of the object. They show all the important properties of the object in the form of data and method attributes.
The objects are the instances of objects. When the new objects are created that allows the design of that object to depend on the class it belongs to.
Encapsulation binds the data and objects together. It puts them into one module.
Abstraction focuses on data hiding, it keeps the data intact as a private substance. Not revealed to outside world or user.
Polymorphism is an ability of an object to present itself in multiple forms. This is mainly visible via constructor or function overloading or overriding.
Inheritance is the procedure of deriving features such as method and data members from parent classes. This is broadly determined depending upon mode of inheritance that's public or private. This is basically sharing of member function or methods from parent classes. Hence the compiler treats objects differently based on their data type or class whether it belongs to parent or child classes.