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
inna [77]
3 years ago
6

Overloading in methods are popular in programming, and why overloading is important.

Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
5 0

Answer:

 Yes, overloading is one of the methods which are popular in programming language. Overloading basically refers to the same function but different signature called function overloading or method overloading. It is the ability to define the multiples method by using the single identifier.

The overloading is important because it has the ability to design the multiple method by using similar name. It also provide the high flexibility to the programmers to call the same method in the data. overloading basically provide the high clarity in the code.

Overloading is used to achieved the compile time polymorphism.  

Following are program of function overloading in c++ are:

Class abc // creating class

{

public:

int p;

void fun() // function fun with no parameter/

{

cout<<” hello “;

}

void fun(int a) // function fun with parameter

{

p=a;

cout<<p;

}

};

int main() // main function

{

abc ob; // creating object

ob.fun();// print hello;

ob.fun(6);// print 6

return 0;

}

Explanation:

In this program the function fun() have same name but different signature in the main method we create the object of class abc i.e ob. ob.fun() this statement called the function with no parameter and ob.fun(6) this statement will called the function with integer parameter.

You might be interested in
What is the way to discover requirments for software projects ?
Sav [38]

Learn about requirement analysis by knowing how to identify business requirements and software requirements with ... Here are the objectives for performing requirement analysis in the early stage of a software project:.

6 0
2 years ago
For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
My name is Ann [436]

Answer:

The answer is "Option d".

Explanation:

Please find the complete question in the attached file.

8 0
3 years ago
Types of computer viruses<br>​
e-lub [12.9K]

Answer:anti various

Explanation:hope fully this will help u

5 0
3 years ago
Read 2 more answers
Select all that apply. To select more than one worksheet at the same time, which of the following keys on your keyboard can you
Colt1911 [192]
<em>Shift </em>selects multiple worksheets at the same time. <em>Ctrl</em> selects all that you selected with Ctrl pressed.
4 0
3 years ago
Can i have help for a ggogle class room
andrew11 [14]

Answer:

or tell ur teacher to add u in ur class

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • What type of malware is heavily dependent on a user in order to spread?
    11·1 answer
  • Which of the following domain types is most trustworthy 1) .com 2) .tv 3).org 4) .edu
    15·2 answers
  • Explain in three to four sentences what happens to data packets once they leave a node.
    11·2 answers
  • Services such as water, electricity, and phone communications are called:
    7·1 answer
  • Does anyone know how to fix this???
    11·1 answer
  • An important communication principle states ""prepare before you communicate."" How should this preparation manifest itself in t
    10·1 answer
  • Please select the word from the list that best fits the definition Asking for review material for a test
    14·2 answers
  • What is a word processing program? Give examples of word processing programs.
    10·1 answer
  • Write a two to three sentence response to the following question:
    5·1 answer
  • Which two choices are examples of trivial file transfer protocol (tftp) use? (choose two. )
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!