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
Modify the countUp( ) you wrote in the previous question to countUp( num), where num is a parameter. The function displays from
algol [13]

Answer:

void countUp(int num)

{

   if(num==0) //base case.

   return;

   countUp(num-1);//Recursive call.

   cout<<num<<" "; //printing the number.

}

for input num=25

Output:-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Explanation:

I have used recursion to print the numbers the function is in c++ language.In every recursive call we are decreasing num by 1.As the base case is reached.Then it will backtrack from 1 to num and then we are printing while backtracking.

4 0
3 years ago
Pleaseee need help ASAP!!<br><br> Will mark BRAINLIEST!! :)
torisob [31]

Answer:

The correct option is Option B

Explanation:

We need to find examples of client-side code.

Client Side code: The part of code, that doesn't require server for performing specific task

SO, The correct option is Option B

Prompt for special characters in user name

Reason: We can use alert to generate prompt using JavaScript or through validation and it can be done on client side.

All other options, we need to hit the server to perform the task, So they are not client-side code.

6 0
3 years ago
Ideally, Internet of Things (IoT) devices have the ability to:
Stella [2.4K]

Answer:

I believe the answer would be D

8 0
3 years ago
Some web and mobile applications allow users to share pictures and videos, as well as chat and message. True False
pishuonlain [190]
True ever heard of Instagram or snap chat
8 0
3 years ago
Read 2 more answers
Plz answer all the questions :)
AURORKA [14]

Answer:

is there multiple choice or do i have to answer from my own words??

7 0
3 years ago
Other questions:
  • What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
    13·1 answer
  • To execute a prepared SQL statement, you can use the _______ and execute methods of the PDOStatement object to set parameter val
    9·1 answer
  • no one can succeed in his or her career without relying on others for help or opportunities. It’s best, though,
    13·1 answer
  • Please help me I don’t know what to do
    13·2 answers
  • There is a renewed focus among today’s parents on providing food to their family.
    6·1 answer
  • 60 POINTS IF YOU GET IT RIGHT
    6·2 answers
  • When machining rotors, what is the reason for setting the indexing collars to zero?
    9·1 answer
  • What is the main difference between weathering, erosion and leaching​
    9·1 answer
  • Data becomes _______ when it is presented in a format that people can understand and use.
    12·1 answer
  • Question 2 of 10
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!