submission prep
submission prep
• Achieved using method overloading, where multiple methods have the same name but
different parameters.
Code:
class CompileTimePoly {
// Method Overloading
void display(int a) {
void display(double a) {
void display(String a) {
}
Output:
Integer value: 10
Code:
class Parent {
void show() {
@Override
void show() {
}
}
Output:
Parent class method