The following program is Overloading or Overriding?
public class PolymorphismEx {
public int sampleMethod(int a) {
return a;
}
public String sampleMethod(int a) {
return "Is it Overloading or Overriding???";
}
}
Answer Posted / venkat asha reddy
it is neither overloading nor overriding. it throws method
ambiguity exception while compiling
| Is This Answer Correct ? | 16 Yes | 1 No |
Post New Answer View All Answers
What is matcher in java?
what do you mean by marker interface in java?
Does .length start 0 java?
What do the thread?class methods run() and start() do?
I want to persist data of objects for later use. What is the best approach to do so?
Is string pool garbage collected?
Explain the scope or life time of class variables or static variables?
How do you square a number?
What is use of map in java?
What are the benefits of immutable objects?
Why we cannot override static method?
What is the purpose of object oriented programming?
How do you compare objects in java?
What is internal iteration in java se 8?
What is the difference between pass by reference and pass by pointer?