<>
is called the diamond. Using it, we don't have to re-specify our HashMap's types upon initialization. That's called type inference.
Psst: we're using Integer
, an object that contains an int
-type value, because HashMaps only take objects.
Yikes! The fact that we don't have to repeat the type goes for both the key and the value. Let's try a shorthand initialization instead.