class arijit { public static void main(String args[]) { System.out.println(\"Base class main\"); amit ab=new amit(); //how is it possible as the sub class object a
Its simple as you can create an object in the class of the same class type, you can create its subclass type too.