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
Activities provided for the satisfaction of others and consumed at the time of purchase<br> are…
Natasha2012 [34]
The answer is services
6 0
3 years ago
To include calculated fields in queries, enter a name for the calculated field, a(n) ____, and then the expression in one of the
Oliga [24]

Answer:

Colon(:) is the correct answer.

Explanation:

The colon(:) is used to contain those fields which is calculated in the queries. In other words, the colon is used to insert the name for that field which is calculated then, the user uses the colon(:) and after that, he uses the expression in the columns or the field row. So, That's why the following option is true.

3 0
3 years ago
To test dns configuration by resolving a host name to ip address, which command or commands can you use
Helga [31]

ping, tracert or nslookup can all be used.

4 0
3 years ago
I am a you tuber that does videos on the rob lox myth community, I have over 250+ subscribers. I was wondering if any of y'all w
Marina86 [1]

Answer:

I will for sure subscribe!!!!

Explanation:

:)

7 0
3 years ago
If I wanted to add code so that the costume of my sprite would change, what menu would I look under to find the "change costume"
Damm [24]

Answer:

D.) Looks

the costume is technically the look of your sprite, so looks is the correct answer

7 0
3 years ago
Other questions:
  • Every preprocessing directive must begin with:
    11·1 answer
  • How to search multiple microsoft word documents?
    15·1 answer
  • How to insert header and page number in word 2016?
    8·1 answer
  • A network monitor records the following information while recording a network connection.
    9·1 answer
  • In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
    13·1 answer
  • What are two types of crust on the earths surface
    15·2 answers
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to
    9·1 answer
  • Two forms of compression are lossy and lossless. State giving reasons which
    8·1 answer
  • Describe some things that this person might say that might cause you to NOT hire them. Explain.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!