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 / jagadish
Duplicate Method sampleMethod(int a) Error Message will display
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we write method inside a method in java?
What is lastindexof in java?
What is the method overriding?
What is the point of java?
Difference between this() and super() ?
What are the advantages of passing this into a method instead of the current class object itself?
Explain treeset?
what are abstract functions?
What is a condition in java?
String class is defined under which package in java?
Why a dead thread occurs?
What is pojo class in java?
What are the different approaches to implement a function to generate a random number?
How do you check whether the list is empty or not in java?
Give a practical example of singleton class usage?