Equal First Letter

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

No.

Equal First Letter

The first letters of "fox" and "flypaper" are the same but the strings differ in their tails.

If the tails of two strings that start with the same letter were equal, then the two strings are equal. Here is that rule:

equals( x+X, y+Y ) = true  if x == y and equals( X, Y )

This means that if you see two strings that start with different characters, they the strings are not equal. For example,

equals( "bat", "radio" ) = false

In this example, x is the character 'b', X is the string "at", y is the character 'r', Y is the string "adio".

QUESTION 13:

Is "ox" equal to "ox" ?