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 are latest features introduced with java 8?
Explain the purpose of garbage collection in Java?
How to create packages in java?
What is the purpose of javac exe?
What is the use of hashmap in java?
What about main thread in java?
Explain 5 features introduced in jdk 1.7?
Why is a singleton bad?
If system.exit (0); is written at the end of the try block, will the finally block still execute?
Why strings in java are called as immutable?
What is immutable class in java?
What are exceptions
What is type conversion in java?
What is size () in java?
What is merge sort in java?