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 / kvsravindrareddy
Its kind of overriding, but the program will give compilation
error. why because Overriding cannot be possible within the
same class. or Duplicate method cannot possible within the
same class.
Is This Answer Correct ? | 13 Yes | 5 No |
Post New Answer View All Answers
Why is singleton not thread safe?
What is the dot operator?
What is a boolean field?
What is singleton class in ruby?
Difference between operator overloading and function overloading
What is abstract class constructor called?
What does ide stand for?
Can you call a method in a method?
What are the differences between include directive and include action?
What is immutable class in java?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
What is meant by nested loop?
How many threads does a core java have?
What is a string token?
Explain about doubly linked list