References
==========

``` {.java}
Person a = new Person("Marc");
Person b = a;
a.setName("Marcus");
b = new Person("Marcus");
```

`a == b`? And, `a.equals(b)`?

a.  true, true
b.  true, false
c.  *false, true*
d.  false, false

Interfaces
==========

Which of the following may a Java interface **not** have?

a.  *a constructor*
b.  an interface extending it
c.  two or more interfaces it extends
d.  an abstract method

Observers and transformers
==========================

Suppose a `Dog` class has a method `double getWeight()` that returns a
dog's weight, and a method `void vaccinate()` that sets the dog's
vaccination status to `true`. Are these methods observers or
transformers?

a.  both are observers
b.  *`getWeight` is an observer, `vaccinate` is a transformer*
c.  both are transformers
d.  `Dog`s have retrievers, setters, and pointers, not getters.
e.  `getWeight` is an observer, but `vaccinate` is not a transformer

Alternate implementation choice 1
=================================

Suppose we instead decided to have a boolean field `full` that we used
to track when the array filled up. Which of the following is **false**?

a.  `full` would be set `false` by each constructor
b.  `isFull()` might run faster
c.  `insert()` might need to update `full`
d.  *`full` would never change from `true` to `false`*
e.  this question is dumb and confusing, Marc *also acceptable*

Preconditions
=============

``` {.java}
// precondition: StringLog is not full
public void insert (String element) {
  lastIndex++;
  log[lastIndex] = element;
}
```

What will happen if `insert()` is called when when the StringLog is
full?

a.  the compiler won't let this happen
b.  the StringLog object will be destroyed
c.  *an `ArrayIndexOutOfBoundsException` will be thrown*
d.  a `NullPointerException` will be thrown

Alternate implementation choice 2
=================================

Suppose instead of `lastIndex`, we keep `nextIndex`: the next index of
the array we're going to store into. Which of the following is true?

a.  `isFull` should return `nextIndex == log.length - 1`
b.  there is no way to avoid an `ArrayOutOfBoundsException` if we make
    this implementation choice
c.  *`isFull` should return `nextIndex == log.length`*
d.  `nextIndex` must be initialized to `-1` in all constructors

