Pass-by-What?
- Draw the box-and-pointer diagram after Java evaluates the main method. What would Java print?
- On line 19, we set level equal to 50. What level do we mean? An instance variable of the Pokemon class? The local variable containing the parameter to the change method? The local variable in the main method? Something else?
Static Methods and Variables
- Write what will happen after each call of
play()
in the following method
- If we were to add
Cat.nickname("KitKat")
to the end of our main function,what would happen?Practice with Linked Lists
Draw the box-and-pointer diagram that results from running the following code. A StringList is similar to an IntList. It has two instance variables, first and restSolution
disc02sol.pdf