while (currentNode != null) {
Letter currentLetter = currentNode.getElement();
if (currentLetter.decorator() != "!") {
return false;
}
currentNode = currentNode.getNext();
}
return true;
In the attached picture, you can see currentLetter.decorator() = "!", so the if statement should evaluate to false, but the method returns false immediately, meaning the if branch somehow executed. This really shouldn't be that difficult, I must be missing something small because I have no idea why this is happening. Any help would be much appreciated.