class Top{
public Top(String s){System.out.print("B");}
}
public class Bottom2 extends Top{
public Bottom2(String s){System.out.print("D");}
public static void main(String args[]){
new Bottom2("C");
System.out.println(" ");
} }
In the above program, I guessed the output must be BD
, but in the book they said the compilation fails. Can anyone explain this?