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 is a computer briage coures​
Stella [2.4K]

what's your choices for this question

4 0
2 years ago
How can i learn about networks
timama [110]

Answer:

1. Clients and servers—how services such as e-mail and web pages connect using networks.

2. IP addresses—how devices on a network can be found.

3. Network hubs, switches and cables—the hardware building blocks of any network.

4. Routers and firewalls—how to organize and control the flow of traffic on a network.

3 0
3 years ago
Which of the following best reflects why lighting systems are used when filming on location outdoors? (Select all that apply.)
cupoosta [38]
<h2>All the given answers are right</h2>

Explanation:

  • Lighting is one of the key factor which is essential to do cinematography
  • It will help to cut off the shadows that is created using natural light
  • It can depict the mood of the scene that is shoot
  • We can adjust manually brightness and darkness according to the need, which is not possible in the natural light.
  • It can boost the quality of the footage
  • We can shoot anytime irrespective of the weather condition
  • The light from the camera alone is not enough to shoot the best picture
8 0
3 years ago
How should you respond to the theft of your identity cyber awareness.
antiseptic1488 [7]

The way to respond to the theft of your identity cyber awareness is; To report the crime to the local commission which is the Federal Trade Commission (FTC).

<h3>Protection from Identity Theft</h3>

Identity Theft is basically a crime that happens happens when someone steals your personal information and uses it commit a fraudulent offence.

Now, the person that stole your identity may use the stolen information he got from you to apply for credit, file taxes, medical services or other government privileges.

The acts perpetuated above by the thief could lead to damage to your reputation with credit status and your good name too which could take years to rebuild.

Thus, it is very pertinent to report any case of such to the relevant government commission which in this case is Federal Trade Commission (FTC).

Read more about Identity Theft at; brainly.com/question/15252417

5 0
2 years ago
Assume the method doSomething has been defined as follows: public static void doSomething (int[] values, int p1, int p2) { int t
Dmitriy789 [7]

Answer:

The answer to this question is option "b".

Explanation:

In the method definition, we perform swapping. To perform swapping we define a variable "temp" that swap values of variable p1 and p2 and store in array that is "values". and other options are not correct that can be defined as:

  • In option a, It does not insert any new value in array because we do not pass any value in function.
  • In option c, The function does not copy and assign a value in a new array because in this function we not assign any new array.  
  • In option d, It is incorrect because it can not move an element into high index position.
8 0
2 years ago
Other questions:
  • Don is the superintendent of the county school system. What task might Don
    8·1 answer
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • In chapter 3, we discussed syntax and semantics, in general there are two types of grammars for programming languages, regular a
    14·1 answer
  • _____ involves storing data and running applications outside the company’s firewall. answer grid computing parallel computing cl
    11·1 answer
  • Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
    9·1 answer
  • In needs analysis: Group of answer choices the costs of different physical network design alternatives are assessed the rate of
    10·1 answer
  • Which of the following statements is NOT
    15·1 answer
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • Select the correct answer.
    14·1 answer
  • What can be used to help diagnose and fix computer hardware problems?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!