0
Generic arrays do not compile in playground, BROKEN!
@SuppressWarnings("unchecked") throws an error. The generic array is initialized the following way: T[] t = (T[]) new Object [SOME_CAPACITY]; This code should work, https://code.sololearn.com/c8mOlo7lq988/?ref=app
2 odpowiedzi
+ 3
It should not work, you are using t both as a variable and a parameter.
0
@Jacob Pembleton
Thanks. Forgot to reference the class instance inside the add method.