[Solved] Method error – missing return statement in Java

[ad_1]

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;

[ad_2]

solved Method error – missing return statement in Java