I have an abstract class and one class that extend it, I have a method with same name in both class. I want to call the method in abstract class in another method of abstract class.
Controller.java
public abstract class Controller {
public Result delete(Long id) {
return this.delete(id, true);
}
public Result delete(Long id, boolean useTransaction) {
// do something and return result
}
}
FileGroup.java
public class FileGroup extends Controller {
public Result delete(Long id, boolean central) {
// do something
return super.delete(id);
}
}
super.delete
call Controller.delete
but this.delete(id, true)
call delete
in FileGroup
instead of calling delete
in Controller
which is causing recursive infinite loop and stack overflows.