ArrayList<SP> sps = new ArrayList<SP>();
, ArrayList SP, ArrayList SP, , SP.
, new SP("1");, object to SP, . , new SP("1");. , .
But in your ArrayList (for the same statement) there will be a link to accept the return from constructor of SP. Therefore, when you remove this object from the list, it loses its only link and gets the right to garbage collection.
Refernce: Call methods for a reference variable vs Call methods for a new object
source
share