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 scope & storage allocation of static, local and register variables? Explain with an example.
What is backdrop?
What is the difference between double and float variables in java?
Can we declare the static variables and methods in an abstract class?
What is the exact difference in between Unicast and Multicast object?
What is the static method?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
What is array length?
When do you get classcastexception?
What are the super most classes for all the streams?
What is the internal implementation of set in java?
Why is java multithreaded?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
What is the use of arraylist in java?
What does t in java mean?