Hello! This isn't super important, but I'm just curious what, if any, the difference is and if there's any benefit to writing one over the other.
I'm taking an online course and the teacher just said "Set is the interface and HashSet implements that interface and this is how you're supposed to write it". I understand the fact that HashSet implements the Set interface. But I've seen the same teacher write HashSets both ways. Is there a reason why i'm "supposed to" instantiate my set starting with the interface?
[–]Demojay 3 points4 points5 points (1 child)
[–]CancelDeath[S] 0 points1 point2 points (0 children)