A. How to deal with "What does this program do?"?
Examples: 2015-2016 c1-c4, 2016-2017 c1-c4
B. ArrayList in Java
1) An array list starts from an empty list and can grow or shrink. For instance:
ArrayList<String> suits = new ArrayList<String>(); // empty initially
suits.add("club"); // now it has 1 element
suits.add("diamond"); // now it has 2 element
2) In general, the following methods of array lists can help you to play lots of card games, and do other stuff :)
size();
add(aStringOrNumber);
add(int index, aStringOrNumber);
remove(int index);
remove(aStringOrNumber); // remove the first occurrence of aStringOrNumber.
get(int index);
set(int index, aStringOrNumber);
3) Detailed explanations and examples of the above methods can be found here
C. Now see if you can figure out "What does this program do?" in 2017-2018c4jr or solve this card game.
RI
c.4 : 12