Things I looked up!

  • Question 4: I had to check which way integers round in java because I wasn’t sure
  • Question 12: I had to learn how substring(int, int) works. You can see my testing below.
  • Question 22: I got help from Ryan and realized that it actually was the one that said variables of type book can only call book methods even though it was initialized with a child class, in order to call a function in AudioBook it would have to be typecasted to audiobook.
  • Question 23: I also got help from Ryan to understand this one.
String string = "0123456";

System.out.println(string.substring(4,7));
456

Corrections

  • Question 39: I missed that recur runs twice, so I got 8 instead of 16