Hi the follwing program gives me compile time error saying that
"super() method calls only allowed in constructors"
Please exaplin me the cause for error.
class Sup1{
public Sup1(){
System.out.println("Hai");
}
private Sup1(
String str){
System.out.println(str);
}
}
public class Test5 extends Sup1{
private Test5(String str){
System.out.println(str);
super(); //This line causes problem
}
public static void main(String[] args) {
Test5 t5 = new Test5("HI");
}
}