Exception in thread \"main\" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604)
You are trying to access the first element lstpp.get(0) of an empty array. Just add an element to your array and check for !lstpp.isEmpty() before accessing an element
lstpp.get(0)
!lstpp.isEmpty()