Is it required to nullify ArrayList before recreating an object?
I am not sure if it is going to consume more & more memory while working
with the arraylist. I am confused when going through following block of
code:
List<String> headerRow = new ArrayList<String>();
headerRow = new ArrayList<>();
headerRow.add("");
xlHeader.add(headerRow);
// headerRow = null; //<----- This is the line of
confusion.
headerRow = new ArrayList<>();
Should the headerRow be nullified ?
What will happed to the Blank String Object ("") added to headerRow ?
No comments:
Post a Comment