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]
3 years ago
11

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

Computers and Technology
1 answer:
levacccp [35]3 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
A _____ is a predefined text format that includes multiple formatting options.
VladimirAG [237]
A style is a predefined text format that includes multiple formatting options.
7 0
3 years ago
Write a program to enter 30 integer numbers into an array and display​
Rama09 [41]

Answer:

i764

Explanation:

3 0
2 years ago
Read 2 more answers
The term used to describe the shape and layout of a computer component such as a motherboard or hard drive is __ factor?
Flauer [41]
FORM factor. Example are ATX, micro ATX, and many more. ATX and MATX are the most common next to servers as well
3 0
3 years ago
Research shows that a passive close to a cover letter leads to more interviews. Please select the best answer from the choices p
Alchen [17]
The answer is False.

According to research, a passive close doesn't lead your cover letter to have more interviews. In writing the closing part of your cover letter, it is easy to have a passive sentence but it sounds like less confidence to the employer. The last part of the cover letter should contain strong content to give an impression to the person who reads.
6 0
2 years ago
Read 2 more answers
In Scratch, you have to choose backdrops from a limited number in the Scratch image library.
forsale [732]
I would say it would be True
5 0
3 years ago
Other questions:
  • What does the picture indicate on the famous book “Dawn of the century”?​
    10·1 answer
  • The box plot represents this data set. {16, 16, 16, 18, 18, 20, 24, 28, 30, 34} What value does the letter A represent on the bo
    8·2 answers
  • Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
    15·1 answer
  • Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "
    14·1 answer
  • I get brainlist to whoever can help my computer is doing this and I have class and it’s not working and I got it wet yesterday b
    12·2 answers
  • If I am working in a document and wish to follow a hyperlink, what should I do?
    7·1 answer
  • Which activity is the best example of a negative habit that may result from
    12·1 answer
  • What is a file and where can we make use of a file?​
    14·1 answer
  • Which of the following best explains how the Internet is a fault-tolerant system?
    7·2 answers
  • Answer the following question in 3-4 complete sentences. Define the following terms: - registration - press - keyblock.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!