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
Can we use return in constructor?
What is return code?
What are synchronized methods and synchronized statements in java programming?
Which variable is the independent variable?
Is vector ordered in java?
What does file separator do in java?
What is api in java?
What is the use of set in java?
What are accessor methods in java?
how we can create packages in java?
Is java a pure object oriented language?
What is data string?
What is assembly used for?
How can we use primitive data types as objects?
Difference between ‘is-a’ and ‘has-a’ relationship in java?