What's the difference between the two declarations?
new ArrayList<String>();
new ArrayList();
They work, but the second one returns a warning. I don't understand why.
I understand the difference between ArrayList<String> arr
and ArrayList arr
, the first enables a type checking control. But what about new ArrayList<String>()
and new ArrayList()
? Is there any difference at implementation level? What do I lose in terms of controls?