接口类:
package com.imekaku.jdbc; /** * Created by lee on 17/2/24. */ public interface OneInterface { String hello(String word); }
实现类:
package com.imekaku.jdbc; /** * Created by lee on 17/2/24. */ public class OneInterfaceImpl implements OneInterface { public String hello(String word) { return "Word from interface Oneinterface." + "Word"; } }
Main:
package com.imekaku.jdbc; /** * Created by lee on 17/2/24. */ public class Main { public static void main(String[] args) { OneInterface oneInterface = new OneInterfaceImpl(); System.out.println(oneInterface.hello("imekaku")); } }