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
Which of the following lines correctly defines a String variable
lidiya [134]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is C i.e. String s = "apluse";

The rule or syntax of declaring string in any programming language is given below:

String variable-name = "yourString";

For declaring string variable, first, you write "String" that is a keyword of a programming languages for declaring string variables, such as int before the variable name for declaring integer variable. Then, you need to write a meaningful name of the string as a variable. After string variable name, you need to put the equal operator and then write the string in double quotation("") marks and after that put the instruction terminator that is ";".

So, according to this syntax, option C is correct.

While other options are not correct because:

In option a, string is not encapsulated in double quotation. Option B does not have varaible type such as String and Option E does not have variable name and its value also. So, only option C is correct and all other except C are incorrect.

3 0
2 years ago
Any song recommendations, pls dont say 6ix9ine or lil pump
gogolik [260]

I actually do have one tho. Try Megan Tha Stallion.

8 0
2 years ago
Read 2 more answers
Why is there more than one Brainly website?
marta [7]

they are for different countries and languages

8 0
2 years ago
Read 2 more answers
An independent frame that holds a program, document, or folder contents in windows 7 is called a ____.
svetlana [45]
Window.

Have a wonderful day!~
7 0
3 years ago
If you type too much text on a PowerPoint slide the additional text is _____
IrinaK [193]
The text just goes out of the slide and you can't see it until you lower the font size or until you delete some of it.
3 0
2 years ago
Other questions:
  • Which sentences in the passage show the preventive measures to avoid data breach?
    9·1 answer
  • You are asked to install a device that will combine several connections to the Internet and provide the sum of the available net
    8·2 answers
  • Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer va
    7·1 answer
  • Nonverbal messages from the movie it​
    5·2 answers
  • A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The n
    5·1 answer
  • Which lighting direction is used to create silhouettes
    15·1 answer
  • Discuss, in detail, the usefulness of graphics and images in program development. Explain the importance of the interface of a c
    7·1 answer
  • whenever I try to make an account it says it can't sign me up at this time or something- can you help?-
    10·1 answer
  • You have installed Windows Server 2016 on a new server and want to centralize user logons and security policies. What type of so
    13·1 answer
  • Why is it important to continiously conduct penetration testing for a strong security system?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!