what is overloading in java?

Answer Posted / ak

Overloading is when the same method or operator can be used
on many different types of data.

For instance the + sign is used to add ints as well as
concatenate strings. The plus sign behaves differently
depending on the type of its arguments. Therefore the plus
sign is inherently overloaded.

Methods can be overloaded as well..same method with
different parameters is said to be method overloading.----
we can perform the similar operation in different ways for
different parameters.

Constructors can be overloaded as well...Overloaded
constructors provide multiple ways to initialize a new object

Is This Answer Correct ?    69 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the high-level thread states? : Java thread

789


Do extraneous variables affect validity?

721


How transient variable is different from volatile variable?

785


What kind of variables can a class consist?

815


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

792


What is Major and importance difference between for and foreach loop ?

845


What does provide mean construction?

839


What is a heavyweight component?

771


What are the different types of inheritance in java?

780


Explain what is Marker interface?

859


What is a ternary operator in java?

771


what is session in java?

1000


Can a static block throw exception?

870


What is a vararg?

761


Why string is not a wrapper class?

915