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

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

Computers and Technology
1 answer:
levacccp [35]4 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 does it mean by null in programming?
Marysya12 [62]
In computer programming<span>, </span>null<span> is both a value and a pointer. </span>Null<span> is a built-in constant that has a value of zero. It is the same as the character \0 used to terminate strings in C. </span>Null<span> can also be the value of a pointer, which is the same as zero unless the CPU supports a special bit pattern for a </span>null<span> pointer.</span>
8 0
3 years ago
Complete the statement below with the correct term.
kvv77 [185]

Answer:

clone

Explanation:

Many manufacturers always ensure their products are accompanied by a user manual and and a driver in a CD or can be obtained from their website to guide users on how to operate the device.

If the device has neither, it means it has been refurbished or its an imitation of the original make.

Cloned devices can easily malfunction and trouble shooting them tends to be a matter of guess work. Compared to the real device, their prices are normally  cheap compared to the real devices.

7 0
3 years ago
Read 2 more answers
Window server how it works
bearhunter [10]
The server handles the administrative group-related activities on a network. It basically stores, recover and send the files to all the devices that are connected to the network of that server. Windows has made a line of operating systems specifically for use in servers.
Windows Server is a group of operating systems designed by Microsoft that supports enterprise-level management, data storage, applications, and communications. Previous versions of Windows Server have focused on stability, security, networking, and various improvements to the file system.
A window is a separate viewing area on a computer display screen in a system that allows multiple viewing areas as part of a graphical user interface ( GUI ). Windows are managed by a windows manager as part of a windowing system . A window can usually be resized by the user.
4 0
3 years ago
Write a recursive method to form the sum of two positive integers a and b. Test your program by calling it from a main program t
77julia77 [94]

Answer:

see the code snippet below writing in Kotlin Language

Explanation:

fun main(args: Array<String>) {

   sumOfNumbers()

}

fun sumOfNumbers(): Int{

   var firstNum:Int

   var secondNum:Int

   println("Enter the value of first +ve Number")

   firstNum= Integer.valueOf(readLine())

   println("Enter the value of second +ve Number")

   secondNum= Integer.valueOf(readLine())

   var sum:Int= firstNum+secondNum

  println("The sum of $firstNum and $secondNum is $sum")

   return sum

}

5 0
3 years ago
Sarah has an audio file to insert into a presentation, but she does not want the entire file to play. What should she do to have
Sonja [21]

Answer:

3. Use the Trim Audio dialog box. :3

3 0
3 years ago
Read 2 more answers
Other questions:
  • What is the main type of energy used to help convert metamorphic rocks into igneous rocks in the rock cycle ?
    10·1 answer
  • A Linux-based OS is called a _____.
    9·1 answer
  • The objective is to write the program that can help you process the database. Your program should be able to (1) display the dat
    14·1 answer
  • An extract report lists ____________.
    14·1 answer
  • How can I watch you-tube on my school computer without it being blocked on the computer when it uses Lightspeed Systems Relay or
    7·1 answer
  • Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the custome
    5·1 answer
  • What makes this information systems environment unique? (3 points)
    7·1 answer
  • Why authentication processes and features important
    10·1 answer
  • Write the algorithm for finding the perimeter of a rectangle using English like form step by step
    10·1 answer
  • Which of the following is NOT a reason why supply chain infections areconsidered especially dangerous?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!