Java abstract methods and interface implementation calls?

there are methods in the interface:

after()
before()
doInit()

when calling, I want to call the above three methods in this method by calling a method execute () . How should I design the class?

there are two ways of thinking now:

    Add a method to the
  1. interface: execute () , and call the above three methods during implementation.
  2. adds an abstract method, and then there is a excute () that also calls three.

personally, it seems better to use abstract methods, but I don"t know what"s good about it, or if there is a better design.

Thank you


if you need to call multiple times, select method 2. If you only call three methods once or twice, it is recommended that three methods be called directly


cannot be discussed in this way. The key depends on the original intention of the design of this API. How to locate this interface and what problems should be solved? Whether execute is a method of an interface, if so, it can be directly used as a method of an interface, if not, what is the scenario that execute is trying to solve

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9d936-690da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9d936-690da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?