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
Is binary a low level language?
Is hashset ordered?
Can we create more than one object singleton class?
What are the benefits of operations?
What method is used to specify a container's layout in java programming?
what are abstract functions?
Is 0 an irrational number?
Can we override the overloaded method?
What is the independent variable in an experiment?
Which is better list or arraylist in java?
Explain illegalmonitorstateexception and when it will be thrown?
Whats the difference between notify() and notifyall()?
What are generic methods?
what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread
What is package protected in java?