1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zheka24 [161]
4 years ago
11

Explain the concepts o f polymorphism, Encapsulation, Inheritance in detail with suitable examples?

Computers and Technology
1 answer:
levacccp [35]4 years ago
8 0

Answer:

Encapsulation:-It is the binding of the data and functions so that they works as one unit.

Inheritance:-When one class acquires the property of another class it is called inheritance.

Polymorphism :-It generally means more than one form

Explanation:

Encapsulation:- class is an example of encapsulation it can hold different data types and functions in a single container called class.

class Name{

public:

string first_name;

string last_name;

void Display()

{

cout<<first_name<<" "<<last_name<<endl;

}

};

Inheritance:-The property of a class acquiring the properties of another class is called inheritance.

Now we will inherit the above defined class.

class person: public Name

{

public:

char gender;

int age;

void Display()

{

cout<<first_name<<" "<<last_name<<gender<<age<<endl;

}

};

int main()

{

Name n;

person p;

n.Display();

p.Display();

}

Polymorphism- There are two types of polymorphism:-

1.Run time polymorphism=The values are decided at run time.

2.Compile time polymorphism=The values are decided at compile time.

Example:-In the above example we have function Display() in both the classes.This is an example of compile-time polymorphism. We are deciding at the time of compilation which display to use.

You might be interested in
What computer part do you need to make you’re pc run faster?
Alisiya [41]
There are multiple things that effect the speed of your computer such as the processer, RAM, and what is on the computer itself. The first question would be to figure out what might be slowing down your computer and the reason for needing the increase in speed. This will tell you what part you need and the steps to take.
3 0
3 years ago
What group in the Home tab would be
Korvikt [17]

Answer:

Number

Explanation:

Number group in the Home tab would be  used to change the format of cell B2 to  match cell B4.

In an application or web page, the home tab is a tab that takes you to the home section.

In Microsoft Word, Microsoft Excel, Microsoft PowerPoint, the Home tab is the default tab.

So, the correct option is Number.

6 0
3 years ago
If your attack seems unsuccessful, one thing that you can investigate is whether the SYN cookie mechanism is turned on. SYN cook
kykrilka [37]

Answer:

suds systolic -a I believe

Explanation:

5 0
4 years ago
What option in the zone aging/scavenging properties dialog box will prevent dns record time stamps from being updated too often?
professor190 [17]

Answer:

The statement is true

Explanation:

5 0
1 year ago
Read 2 more answers
A single machine server that allows multiple users to access that machine simultaneously must have what type of os installed
ziro4ka [17]
The server would have a Multiuser OS installed.
8 0
3 years ago
Other questions:
  • Why is the Vigenere cipher hard to crack? (select 2)
    6·1 answer
  • Word processing software allows users to do which of the following: format text design pages share documents mail merge document
    14·2 answers
  • Which process alters readable data into unreadable form to prevent unauthorized access known as?
    8·1 answer
  • Write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as wel
    15·1 answer
  • Formulate it as a tree search problem.
    15·1 answer
  • What is a goal?
    13·1 answer
  • Simple example of hybrid computer​
    7·2 answers
  • Can someone suggest how to manage a group when you are the group leader?​
    10·2 answers
  • Can someone help plz, I’d really appreciate it
    7·1 answer
  • Class ____________ allow you to create one version of a class, without having to replicate code to handle multiple data types.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!