shahid
Why does this code prints fAfA instead of fBfA ?
0 Answer(s)      a year and 10 months ago
Posted in : Java Beginners
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 ?
Advertisement
View Answers









Related Tutorials/Questions & Answers: