Syntax error, insert “VariableDeclarators” to complete LocalVariableDeclaration occurs

To make the Syntax error disappear and to assign a value to distanceTraveledmodify the method public Water update(int time) as follows:

public Water update(int time) {
    graphic.draw();
    distanceTraveled = 1; // assign a value before returning
    return Water.this;
}

Maybe you should read a bit about Java and doing some tutorials, because this is very basic stuff (at least if I’m not getting you wrong).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)