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 different types of multitasking?
Why do we need array in java?
Which oo concept is achieved by using overloading and overriding?
Can a top level class be private or protected?
What is difference between adapter class and listener?
What is a file pointer?
Lowest Common ancestor in a Binary Search Tree and Binary Tree.
How to change value in arraylist java?
describe method overloading
What is difference between path and classpath in java?
Explain wait(), notify() and notifyall() methods of object class ?
What is polymorphism java example?
What is arrays sort in java?
What is better- service oriented or batch oriented solutions?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?