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
Is boolean a wrapper class in java?
Why Java doesn’t support multiple inheritance?
Is there any case when finally will not be executed?
Can we override data members in java?
What is a double?
Which package has light weight components?
What are the types of relation?
What are decalarations?
Is arraylist a class in java?
What is final access modifier in java?
What is a platform?
When does a class need a virtual destructor?
What does system.gc() and runtime.gc() methods do?
Give me some null interfaces in java?
What is thread safe java?