馬老師P6_安全框架專題 馬老師sprIngsecurity核心源碼剖析
public interface TestInterface { ? ?default void init() { ? ? ? ?// init Code ? ?} ? ?void start(); ? ?void finished();}public class TestInterfaceImpl implements TestInterface { ? ?@Override ? ?public void start() { ? ? ? ?// start code ? ?}
1 默認(rèn)方法
方法簽名中使用
default
關(guān)鍵字,當(dāng)類實(shí)現(xiàn)接口時(shí),不必為接口的默認(rèn)方法提供實(shí)現(xiàn)。
標(biāo)簽: