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 a finally block?
What are the high-level thread states in java programming?
Is set ordered?
Explain serialization and deserialization in java?
Why do we need singleton class?
What is indexof?
What do you mean by composition in java?
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
How transient variable is different from volatile variable?
What is the size of a string in java?
What is difference between protected and private?
Is this valid in java ? Can we instantiate interface in java?
How to create packages in java?
Explain abstract class in java?
What is the benefit of abstract class?