

接口類:ihelloworld.java public interface ihelloworld { string sayhelloworld(); }
實現類一: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"; } } 在接口類ihelloworld.java的方法sayhelloworld()上面右鍵,在彈出的菜單中選擇open implementation,如下圖所示: 






新聞熱點
疑難解答