Welcome back! Feeling rusty after the summer is completely normal, and reaching out early is exactly the right move. This quiz walks through the classes & objects foundations that CSC 240 builds on.
There is no grade and no time limit β pick an answer to see whether it's right and why. At the end you'll get a per-topic breakdown showing exactly what to review. Take it as many times as you like.
π Quick reference (open anytime β a 1-minute refresher)
| Class vs. object | A class is a blueprint (defines fields + methods). An object is one concrete instance made with new. Many objects, one class. |
| Field / instance variable | Data that belongs to each object (its state). Usually private. |
| Method | Behavior β code that runs on an object. |
| Encapsulation / data hiding | Keep fields private; expose public methods so outside code can't corrupt the state. |
| Constructor | Special method with the class's name and no return type; initializes a new object. If you write none, Java gives a default no-arg one. |
this | Refers to the current object β e.g. this.name = name; tells the field apart from the parameter. |
| Accessor / mutator | Getter returns a field (getX()); setter changes it (setX(...)), often with validation. |
| static vs. instance | static belongs to the class (shared, no object needed: Math.pow()). instance members belong to each object. |
| References | An object variable holds a reference (an arrow), not the object itself. b = a makes both point to the same object. |
== vs .equals() | == asks "same object?" (reference). .equals() asks "same contents?" β if the class overrides it. Use .equals() for objects. |
null / NPE | null = points to no object. Calling a method on null β NullPointerException. |
toString() | Returns a String describing the object; override it for readable output. |