CB 52 Questions
String str = "0";
str += str + 0 + 8;
System.out.println(str); //output: 0008
str + int assume int are also strings because the string come first
str + int + int + int
.set() return the orginal string
art is between two words, so each individual word doesn't have "art" in it which should return false
.add(#, x) add x to the index number and the value that was orginally on that spot was pushed back by 1
.remove(k) - would return k
list - fixed -> the reason why "baboon" disappeared
However, after baboon is moved to index 1, the loop doesn't end. It will continued to check till it reaches baboon again, and it will be moved to the end.
for (int[] j : arr) //[] is needed because it's a 2d array
I. doesn't not work because for each loop -> delete name - not effect on nameList
II. doesn't work because it will skip a few names since removing names causes size to decrease while k is still increasing
III. works because it starts from the end so it won't effect the names in the front