[Solved] Method error – missing return statement in Java


public boolean insertNode

returns a boolean. If you want to do something in a function without returning anything, just replace

public void insertNode 

Return value is SUPER important in all programming languages. Get used to always put the correct return value of a function (If you precised it on the function’s prototype).

In your case, you should return the only boolean variable you’re using
return found;

solved Method error – missing return statement in Java