Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.
Final method
class Base {
public final doSomething(Object o) {
System.out.println("Object");
}
}
class Derived extends Base {
public doSomething(Integer i) {
System.out.println("Int");
}
}
public static void main(String[] args) {
Base b = new Base();
Base d = new Derived();
b.doSomething(new Integer(0));
d.doSomething(new Integer(0));
}
This will print:
Object
Object
MY DOUBT IS IN THE DERIVED CLASS METHOD ! IS DER D FINAL KEYWORD MISSING ??
Profile Answers by gova007 Questions by gova007
Questions by gova007
Related Answered Questions
Related Open Questions