Java relay creation object

Set < String > set = new HashSet < > ();
Why do you often see such new objects? what are the advantages of
compared with
HashSet < String > set = new HashSet < > ();
?

Feb.27,2021

personal concerns
for Set < String > set = new HashSet < > () , Set is actually an interface, and the interface doesn't care about what the object is, whether it's HashSet,TreeSet or anything else. It is the embodiment of the idea of interface-oriented programming. The advantage of
is that if one day you find that HashSet is not suitable for this location, you need to change it to TreeSet, with sorting function or CopyOnWriteHashSet, that needs to be changed to thread-safe. You only need to modify the way it is created, and you don't need to modify the code in other locations.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c2eed6-16168.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c2eed6-16168.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?