Yep or u use the diamond syntax.... And java does the rest for you...
This is best ArrayList<String> strings = new ArrayList<>(); As the compiler can already infer the type. Assigning to a raw type i.e new ArrayList() isn't best and your IDE should give you a warning.
Обсуждают сегодня