Is the code retyped manually from the book? Didn't you omit a string concatenation operator (double pipe - ||) by chance? I'd say the two SUBSTRs are meant to be concatenated together to form the initials, between lines 2 and 3.
The error message is a bit baffling, but this is because these kind of errors are hard to qualify. If you omit a closing bracket in Java, the compiler's error message also won't be "missing closing bracket", but "illegal start of expression","annotation type not applicable to this kind of expression" or yet something else depending on the exact situation after the missing bracket. You'll learn to recognize this kind of errors and look around for omitted operators, commas and semicolons very soon.
Joined: Mar 12, 2012
Hi Martin Vajsar.
Yes it's manually typed and I have indeed missed the concatenation operator. Thanks for point it out to me.