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
What social impact did the gunpowder have on society?
olga2289 [7]
It had a huge impact people could use other things than bows and arrows to fight in wars.
8 0
3 years ago
Consider this binary search tree:______.
Nitella [24]

Answer:

The new root will be 2.

<em></em>

Explanation:

The binary tree is not properly presented (See attachment)

To answer this; first, we need to order the nodes of the tree in a pre-order traversal.

We use pre-order because the question says if something is removed from the left child.

So, the nodes in pre-order form is: 14, 2, 1, 5, 4, 16.

The root of the binary tree is 14 and if 14 is removed, the next is 2.

<em>Hence, the new root will be 2.</em>

7 0
2 years ago
What is the difference between a switch's physical interface and the vlan interface?
Andreyy89
<span>Switch's physical interface is something as the name itself suggests itself that it is a physical port to which you can plug in a cable or a wire based on its function and usage where as VLAN interface is no physical port but are created virtually when needed.</span>
4 0
3 years ago
Read 2 more answers
Transparency is an important concept in policies related to the handling and use of customer data. Organizations should be trans
Tpy6a [65]

Answer: (C) Response controls

Explanation:

  According to the given question, the response control is not the necessary element while handling the users or customer data as compared to all the other given options that is individual participation, data minimization and the purpose specification.

  • The response control is basically used for exchange the data or any information in an organization but the main disadvantage is that they share all the response and information as they not wait for the request from the users.
  • The all the three other given options expect response control are the important element for handling the customer data as it helps in maintaining the Personal information.  

 Therefore, Option (C) is correct answer.  

6 0
2 years ago
According to the Modern Language Association (MLA) style guidelines, which citation is formatted correctly?
aalyn [17]
A) Marian Shelby. “The Fall of Rome.” Military Forces. n.p., 11 Mar 2009. Web.
14 Oct 2012.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playville has a playground to which
    6·1 answer
  • Write a method for the Customer class that that will return a string representing a bill notice when passed a double value repre
    14·1 answer
  • What part of the network is the point where the responsibility of the administrator ends and the telecommunications providers re
    5·1 answer
  • If you want to conserve ink or toner, you can instruct powerpoint to print ____ documents.
    6·1 answer
  • A single-user database system automatically ensures ____ of the database, because only one transaction is executed at a time.
    13·1 answer
  • This week you will learn about basic code structure. The term structure, as it relates to programming, refers to the decisions y
    14·1 answer
  • How do I create a powershell script to make a Windows user account that is a non-admin user
    7·1 answer
  • Write a description of the photograph to someone who cannot see the photograph. Be sure to include the title of the photograph a
    5·1 answer
  • Working with text in presentation programs is very ____ using text in other applications.
    10·1 answer
  • Why is my internet slow even though the speed test says it is fast
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!