Hi guys
Here I've a question on inheritance...
I'm getting the output as
No argument constructor
Base
Sub
Eventhough I've specified the Base() (No arg constructor);
Can anyone explain what's happening here..
why am I not getting the output as "Baseclass".
Thank you in advance...
[/CODE]
class Base implements I1 {
Base(){
System.out.println("Baseclass");
}
Base(int j){
System.out.println("Base class's j is"+j);
}
}
class Sub extends Base implements I2 {
Sub(){
System.out.println("Subclass");
}
Sub(int i){
//super();
System.out.println("Sub class's i"+i);
}
}
public class Gray {
public static void main(
String []args) {
Base b1 =new Base(2);
Sub s1= new Sub(3);
[CODE}