1.声明接口
public interface getSomething { public String getBread(); }
2.继承与实现接口
public class market implements getSomething//继承接口 { public String getBread()//实现接口 { } }
转载于:https://www.cnblogs.com/SimonGao/p/4961752.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/109252.html原文链接:https://javaforall.net