Grade 11 Computer Science · The bridge to Java
What stays exactly as it was
Why the new language is easier than it looks.
The hard part is already behind you
Facing a page of braces and declarations, it is easy to feel like the first week of seventh grade. But try reading the search in this lesson without knowing Java — chances are you will understand what it does before you understand how it is written.
It is easy to look at the new syntax and think one is starting from scratch. That is simply untrue, and it is worth saying explicitly: everything you learned in four years about how to think about a program — stays. What changed is the spelling.
// the same algorithm you already know, spelled differently
static int search(int[] items, int wanted) {
int low = 0, high = items.length - 1;
while (low <= high) {
int mid = (low + high) / 2;
if (items[mid] == wanted) return mid;
if (items[mid] < wanted) low = mid + 1;
else high = mid - 1;
}
return -1;
}What does need learning afresh
A short list, and it is worth knowing it so as not to scatter attention. The syntax — braces, semicolons, declarations. The types — what exactly each holds and what happens at its limits. The collections — an array and a list work differently from what you knew. And the value-versus-reference distinction — which is in fact the same picture of names and arrows from grade ten, now with explicit rules. Four subjects, and each has a unit of its own this year.
| Carries over unchanged | Needs learning afresh |
|---|---|
| Conditions, loops, functions | The syntax |
| Recursion and algorithms | The types and their limits |
| Design judgement | Collections, and value versus reference |
Example 1 — why the search looks familiar
- The same halving at each step.
- The same correctness argument.
- Only the spelling differs.
Example 2 — what is genuinely hard
- The syntax is learned in a fortnight.
- The judgement is learned in years.
- And you already have the judgement.