Unit 1
Review

Look back at the main ideas, common traps, and your next step.

Common Traps

These are the details most likely to break code or cost points.

Truncation

Integer division and casting can silently cut off decimals.

Overflow

An int can wrap around instead of giving an error.

Quotes & Escapes

Strings need valid quotes, and some characters must be escaped correctly.

substring(from, to)

The second index is not included in the result.

Immutable Strings

A string method usually returns a new result instead of changing the old one.

null vs Empty

"" has length 0, but null has no object at all.

Review Quiz 1

Pick the correct result.

Program.java
java

Review Quiz 2

Pick the correct result.

Program.java
java

Review Quiz 3

Pick the correct result.

Program.java
java

Review Quiz 4

Pick the correct result.

Program.java
java

Review Quiz 5

Pick the correct result.

Program.java
java

Review Quiz 6

Pick the correct result.

Program.java
java

Review Quiz 7

Pick the correct result.

Program.java
java

Review Quiz 8

Pick the correct result.

Program.java
java

Review Quiz 9

Pick the correct result.

Program.java
java

Review Quiz 10

Pick the correct result.

Program.java
java

Before Unit 2

Take these foundations with you into the next unit.

Keep the Basics

Variables, expressions, methods, and strings do not disappear in the next unit.

Keep the Habits

Read code carefully, check types, and save new results when you need them.

Build More

The next unit will keep using these ideas inside longer, more complete programs.