Why does this code prints fAfA instead of fBfA ?

Why does this code prints fAfA instead of fBfA ?

class B {
    void f(){ System.out.print("fB");}
    B(){f(); }
}
public class A extends B{
    void f(){ System.out.print("fA");}
A(){    f();}
public static void main(String[] args) {
            new A();
}}
Why does this code prints fAfA instead of fBfA ?
View Answers

Ads









Related Tutorials/Questions & Answers:

Ads