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 an image buffer?
What is gc()?
Explain super keyword in java.
Can we write any code after throw statement?
How do you delete a list in java?
Write code to implement bubble sort in java?
What is the byte range?
What is meant by class and object in java?
Can you explain the private protected field modifier?
What is multithreading in java?
What is collection sort in java?
Why there is no call by reference in java?
Can a abstract class be defined without any abstract methods?
What is polymorphism and what are the types of it?
I want to re-reach and use an object once it has been garbage collected. How it's possible?