java – Collection Set constructor

I do not understand the difference between these two ways of declaring a constructor:

                Set set1 = new HashSet <> ();
    Set set2 = new HashSet ();

For practical purposes, there is a difference, because the two of them work or it seems that way.

Thanks in advance,
a cordial greeting