hasFinalVariable

Convenience method that decides whether this foreach statement's variable is final. Note that any foreach statement's variable declaration expression (as returned by getVariable) always has either no modifiers, or a single final modifier.

Calling this method on a foreach statement forEachStmt is equivalent to calling forEachStmt.getVariable().getModifiers().isNonEmpty() && forEachStmt.getVariable().getModifiers().get(0).getKeyword() == Modifier.DefaultKeyword.FINAL.

Return

true if this foreach statement's variable is final, and false otherwise.