接口类:ihelloworld.java public interface ihelloworld { string sayhelloworld(); }在接口类ihelloworld.java的方法sayhelloworld()上面右键,在弹出的菜单中选择open implementation,如下图所示:
实现类一:helloworld1.java public class helloworld1 implements ihelloworld { public helloworld1() { super(); } public string sayhelloworld() { return "hello world helloworld1"; } } 实现类二:helloworld2.java public class helloworld2 implements ihelloworld { public helloworld2() { super(); } public string sayhelloworld() { return "hello world helloworld2"; } }
新闻热点
疑难解答