I just have a question about this part of code
list.add(list.remove(0));
Can you pls explain the order of actions here? if remove(0) is performed first, how then add method knows what was in in the 0? It's basically self-explanatory, however, I didn't know we can add to the list and element which we are removing. Please provide some details. Thanks.