answersLogoWhite

0


Best Answer

Method overloading is when two or more methods have the same name, but the computer can differentiate between the methods by looking at the parameters.

Example:

public static void go(int x)

public static void go(double x)

If you pass an int, the first method would be called. If you pass a double, the second method would be called

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Define method overloading and write two method headers that together exhibit overloading?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

define function overloading?

Defining several functions with the same name with unique list of parameters is called as function overloading.


Does WordPad have header and footer?

WordPad does not allow headers and footers. Check out this word processor: http://www.jarte.com/ You can define headers and footers in the Page Setup.


Is it possible to define two methods that have the same name but different parameters?

Yes. It is called Method Overloading in Java


The way the pieces of materail in the fit together define its?

The way the pieces of materails in the rock fit together define its


Can an extern function be defined in a C header file?

Declared is the right word. (Don't define functions in headers, unless you really know what you are doing.)


Rules for function overloading?

It's a way by which you use define the same function for different input types. For example, think about the the operator "+" which in java works for adding integers, floating point numbers and even string concatenation. The way such functionality is achieved is by overloading.


What is need of header file?

The compiler can only see one translation unit at a time, so every translation unit that calls a function (but does not define it) must at least declare that function. Headers allows us to share declarations consistently amongst many translation units with a simple #include directive. Headers can also declare data types, aliases, constants and macros. Functions can also be defined in headers, but these must be declared inline.


If being gay is natural why then aren't there homosexual chickens?

You are wrong. Chickens do exhibit homosexual behavior.Furthermore, we do not define human nature by comparing it to what is natural for other species.


How do you put together the nerf long shot?

define please


What is the difference between polymorphism and method overloading in java?

The dictionary definition of polymorphism refers to a principle in biology in which an organism or species can have many different forms or stages. This principle can also be applied to object-oriented programming and languages like the Java language. Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class.Overriding and Overloading are two techiques to achive polymorphism in Java.Method overloading: When a method in a class having the same method name with different arguments is said to be method overloading. Method overriding : When a method in a class having the same method name with same arguments is said to be method overriding.


Define physics scientifically?

it is the study of math and and chemistry put together


Definition of operator overloading inc plus plus?

to define an additional task to an operator ,we must specify what it means in relation to the class to which the operator is applied.this is done with the help of a special function called operator function ,which describes the task.