Hi,
This is a code from Bruce Eckel's Thinking in
Java public class PrivateOverride {
private void f() {
System.out.println("private f()");
}
public static void main(
String args[]) {
PrivateOverride po = new Derived();
po.f();
}
}
class Derived extends PrivateOverride {
public void f() {
System.out.println("public f()");
}
}
2 question on this...
1.Can u create an object of child class in the parent class itself
2.Why is the o/p "private f()" even though po is an object of type Derived.
Please help !!