# e02 : Midterm Exam

num ready? description exam date
e02 true Midterm Exam Wed 11/16 12:30PM

# Midterm Exam

Link to actual exam (this is only a placeholder after after the exam is complete, graded, and returned): Actual Exam.

Typos and clarifications

## What is covered

• H00 through H06
• Chapters 1 through 16, and portions of Chapter 17 in HFJ (ONLY pages 581 through 595).
• Chapters 1 through 4 in HFDP (Chapter 4, only up through page 137.)
• lab00, through lab06
• Lecture notes from start of course up to the class before the exam.

# Some topics to focus on:

• Lambda Functions (from lecture notes, from lab06)
• Sorting via Lambda functions and comparators (See HFJ Chapter 16, as well as lecture notes)
• Inheritance and Interfaces. See HFJ Chapters 7 and 8.
• See, for example, the second problem from this practice midterm https://ucsb-cs56-f16.github.io/exam/e01/cs56_f16_e01_practice_c/
• That was from a midterm that was preparation for E01, but in fact, we only used the first question from that midterm on E01.
• So, the second question, the one about inheritance and interfaces, and Polymorphism, is fair game.
• Inner classes
• How would you distinguish between the relationship between “inner class” and “outer class”, vs. “parent class” and “derived class”?
• What is special about non-static inner classes? (The textbook describes this using the word “special bond”. But it will not be sufficient to memorize that word, since it is not a well-defined technical term in Java—it is a word particular to this textbook. You must, in fact, try to deeply understand what the book is getting at with that word.)

# Revisit the java.util.ArrayList<E> data structure, in particular.

Here’s why:

• It is one of the fundamental tools of Java programming.
• Problems involving ArrayList<E> are good ways to check whether your fundamental coding skills are strong or weak.
• Be advised: there will be basic coding questions on the exam. The CS department leadership has issued a strong and clear signal that every lower division programming course needs to test basic programming skills on each and every exam. If your basic coding skills need practice, visit: https://ucsb-cs56-pconrad.github.io/resources/practicing_coding/
• If you master ArrayList<E>, the concepts you’ve mastered translate pretty well to the other data structures in java.util.*, such as:
• how to use generics (that whole <E> thing, as in ArrayList<E>, TreeMap<K,V>)
• how to work with collections (e.g. the enhanced for loop such as for (String s : strings) when strings is an ArrayList<String>
• the idea of extends as in being able to explain what the words extends and implements mean in this context:
  public class ArrayList<E>
extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, Serializable


So, in addition to the items above, be sure that you understand some basis things as well:

Note that the exact coverage of each of these exams varies quite a bit, since the pace of topics, and placement of exams during the quarter can vary considerably. You are encouraged to look at all of them as examples of the types of questions you might be asked, but match them against the topics we have covered, vs. the ones we have not covered.

NOTE: NOT ALL PREVIOUS EXAMS ARE AVAILABLE. The available ones are linked to below.