Question

What are the 3 necessary components for a programming language to be considered a Object Oriented...

What are the 3 necessary components for a programming language to be considered a Object Oriented programming language? Explain

0 0
Add a comment Improve this question Transcribed image text
Answer #1

3 necessary components for a programming language to be considered an object oriented programming languages are as follows:-

i-Encapsulation:-

In broad term encapsulation is the process of protecting unwanted access of information and it is generally implemented by using access modifiers like(public,private,internal,protected,protected internal) .

Internally encapsulation is a mechanism of binding fields(object state) and methods(behavior) together into single unit called class.

The encapsulation is mainly archived by creating class.The class is a kind of container or capsule,which encapsulate the set of fields and methods using access modifier to expose to other class.

ii-Inheritance:-

It is the process of sharing the properties and behavior of the base class into the derived class to archive reusability.

The class whose members are inherited is called base class,and the class that inherit those members is called derived class.

In this case the derived class(child class) can obtained all the features of the base class(parent class).

It helps eliminating the use of redundant code.

iii-Polymorphism:-

Polymorphism means ability of an object to behave in multiple ways.

Example-Consider a smart phone, is a single object but it can be used for making calls,listing music,sending emails,taking pictures etc.

When we have a requirement to have same method name for different purpose then we use polymorphism.

There are 2 types of polymorphism:-

a)Static polymorphism:-(or we call Early binding,compile time)

It is generally archieved using operator overloading and method overloading.

Note-Overloading:-Having different method with same name but different parameters or type in a single class is called overloading.

b)Dynamic polymorphism:-(or runtime)

It is generally archieved using method overriding.

Note-Overriding:-An overriden method provides a new implementation of a member that is inherited from a base class.In a base class the method is declared virtual and in the derived class we override the same method.

Add a comment
Know the answer?
Add Answer to:
What are the 3 necessary components for a programming language to be considered a Object Oriented...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT