0

Set set= new TreeSet<>(); vs TreeSet set= new TreeSet<>();

I know we are using the concept of run time polymorphism here, but what is the use of writing this? Is there any advantage to writing one thing over another? both are giving me the correct results. I am learning java right now, help would be great.

0 Answers0