I couldn't find an answer to this exact question anywhere else, but I apologize if it's a duplicate.
I usually see generic initialization done like this, with the type parameter next to the reference type, as well as the object declaration:
Box<Integer> integerBox = new Box<Integer>();
Or, in the "short-hand" method (since Java 7), using the diamond:
Box<Integer> integerBox = new Box<>();
However, I noticed that the code still works after omitting the parameter type next to the object declaration like so:
Box<Integer> integerBox = new Box();
How come? Is this some compiler magic (I'm using NetBeans, by the way).
Thanks in advance.