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 unchangedNeeds learning afresh
Conditions, loops, functionsThe syntax
Recursion and algorithmsThe types and their limits
Design judgementCollections, and value versus reference

Example 1 — why the search looks familiar

  1. The same halving at each step.
  2. The same correctness argument.
  3. Only the spelling differs.

Example 2 — what is genuinely hard

  1. The syntax is learned in a fortnight.
  2. The judgement is learned in years.
  3. And you already have the judgement.
Two halvings found the element. No step here was foreign to you — only the spelling.