What is the purpose of having the concept of overloading?
Answer Posted / sridharan
Consider if u have a string and u want to find the length
of a string, so u have
getLength(String name) method which will return the length
of the string. Also if u feels that u want to find the
length of a string from the specified position or
character. So we can have same name but with one more
parameter to specify the character position. So we will
have getLength(String name, int a)
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the meaning of variables in research?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
What are autoboxing and unboxing? When does it occur?
What is the use of StringTokenizer class?
What is public static?
What is a map? What are the implementations of map?
What is the difference between pass by reference and pass by pointer?
What is number data type in java?
What are "class access modifiers" in Java?
What are the advantages of defining packages in java?
What is treeset in java?
Explain importance of inheritance in java?
Explain differences between collection api and stream api?
Does java list allow null?
What is the difference between super class & sub class?