Copied out of my Lewis and Loftus book.
code section:
private static boolean beginsWithBlend(String word) { return (word.startsWith("bl" || word.startsWith("sc") || word.startsWith("br") || word.startsWith("sh") || word.startsWith("ch") || word.startsWith("sh") || word.startsWith("cl") || word.startsWith("sk") || word.startsWith("cr") || word.startsWith("sl") || word.startsWith("dr") || word.startsWith("sn") || word.startsWith("dw") || word.startsWith("sm") || word.startsWith("fl") || word.startsWith("sp") || word.startsWith("fr") || word.startsWith("sq") || word.startsWith("gl") || word.startsWith("st") || word.startsWith("gr") || word.startsWith("sw") || word.startsWith("kl") || word.startsWith("th") || word.startsWith("ph") || word.startsWith("tr") || word.startsWith("pl") || word.startsWith("wh") || word.startsWith("pr") || word.startsWith("wr")); }
the whole return statement is red underlined and when i highlight over the red 'i' which indicates the error it is:
cannot find symbol symbol: method starts with(boolean)
Operator || cannot be applied to java.lang.String, boolean
As i said its straight out of my textbook, yet netbeans is saying the || operator cannot be applied in a boolean?