package Constructor;
public class Test2 extends Test1{
Test2() {
//super();
super("Bhanu");
System.out.println("I am from child default constructor");
}
Test2(int a){
this();
System.out.println("I am from child paremeterised constructor");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//Test2 obj = new Test2();
Test2 obj = new Test2(5);
}
}
public class Test2 extends Test1{
Test2() {
//super();
super("Bhanu");
System.out.println("I am from child default constructor");
}
Test2(int a){
this();
System.out.println("I am from child paremeterised constructor");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//Test2 obj = new Test2();
Test2 obj = new Test2(5);
}
}
No comments:
Post a Comment