assuming I have defined a HashSet<String> set
.
What is better in terms of performance:
set.clear;
or
set = new HashSet<String>();
EDIT: the reason I am checking this is that currently my code has the second option, but I want to change it to the first one to make the Set final
.