Main m = new Main();
This code in class B will simply create an object of Main class.  After this you need to call this to  fill the arrayList.
   m.add()
1
solved Java Inheritance not working
 
 Main m = new Main();
This code in class B will simply create an object of Main class.  After this you need to call this to  fill the arrayList.
   m.add()
1
solved Java Inheritance not working