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
Ultraportable computers will often use ___ technology exclusively, even though their storage capacity is lower than that of a tr
ki77a [65]

Answer:

SSD

Explanation:

8 0
2 years ago
To a traditional computer, one means
blagie [28]

a.on , off

In most computer processors, electron movement is controlled by tiny switches that turn this flow of electricity on and off...zero represents off and one represents on

4 0
3 years ago
What is all about programming interactions in the real world.
Lynna [10]

Answer:

Programming is everywhere in the modern world and meets you in the street, your workplace, and the local grocery store. You interact with bar-code scanners regularly, and you almost certainly use lots of code while working, whether you're using a word processor to write a letter or an email platform to send messages. Programs used in real-world environments should also be programmed in the real world, so we have developed a new programming paradigm, “Real-World Programming (RWP),” which enables users to make programs for handling real-world environments as well as data in computers

7 0
2 years ago
An associate is seeking advice on which device to purchase for a friend who is a business owner. The friend needs the ability to
spayn [35]

The best recommendation in the mentioned scenario would be a smart watch.

Answer: Option A.

Explanation:

The best device for a business owner who needs an access to chat as well as to be in touch with the home office would be a smart watch. A smart watch is similar to a mobile device, which is worn on a wrist and which has a touchscreen display.

The benefits of smart watch are numerous. It makes us updated about everything without using our smartphone. The smart watch will help the business owner to engage with others and to handle his work at the same time.

5 0
3 years ago
If the Mona Lisa was in a word document, what would be the orientation
skelet666 [1.2K]
Portrait orientation
8 0
3 years ago
Other questions:
  • When you add an rss feed to hootsuite publisher, posts from blogs and websites you designate will be?
    5·1 answer
  • What is the chief ethical concern concerning all the new sources of data available through new technological means like internet
    9·1 answer
  • What are some situations where you might find it useful to use the “!” symbol in a program?
    9·1 answer
  • A(n) file management system is a program that allows the creation of individual database tables, each of which is stored in its
    5·1 answer
  • To resize columns in a subform, press and hold or right-click the subform in the navigation pane, and tap or click ____ on the s
    12·1 answer
  • How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing
    10·1 answer
  • Why should ERP architecture include a discussion on organizational structure, business processes, and people, instead of just in
    5·1 answer
  • Random number between 0 and 5 (inclusive)
    10·2 answers
  • How can presentation software be used in a
    10·2 answers
  • You have a filtered dataset for Customer Sales with some null value rows. You want to remove these rows completely. How will you
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!