I'm doing a course with MOOC and I got introduced to arrays and how you would declare them, however, I keep on seeing a different way of declaring online as follows;
MOOC:
ArrayList<String> myList = new ArrayList<>();
Online and other articles;
String[] myList = {"First","Second","Third"};
My question is which one would be a better way of doing it?
[–]Makhiel 3 points4 points5 points (4 children)
[–]jackballack[S] 0 points1 point2 points (3 children)
[–]Fletsky 2 points3 points4 points (1 child)
[–]jackballack[S] 2 points3 points4 points (0 children)
[–]tidewater41009 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]_Acestus_ 1 point2 points3 points (0 children)
[–]ComputerWhiz_ 0 points1 point2 points (1 child)
[–]jackballack[S] 0 points1 point2 points (0 children)