Can Abstract Class have constructors?
1. Abstract class can have a constructor. But as we can't instantiate abstract class, we can't access it through the object.
2. To access the constructor create a sub class and extend the abstract class which is having the constructor.
Example public abstract class clsAbstract
{
public clsAbstract()
{
System.out.println(”In clsAbstract()”);
}
}
public class Test extends clsAbstract
{
public static void main(String args[])
{
Test o1=new Test();
}
}