I\'m getting the following error when trying to execute statemet.executeUpdate() in my code:
statemet.executeUpdate()
Local variable statement defined in an enclosing sc
not Error:
JSONObject json1 = getJsonX(); Error:
JSONObject json1 = getJsonX();
JSONObject json2 = null; if(x == y) json2 = getJSONX();
Error: Local variable statement defined in an enclosing scope must be final or effectively final.
But you can write:
JSONObject json2 = (x == y) ? json2 = getJSONX() : null;