Could you give more details?

解决方案 »

  1.   

    这个当然可以,如下有三个类:testInterface.java是接口
    package test;public interface testInterface {
        public void _print(String s);
    }testImp.java是实现类package test;public class testImp implements testInterface
    {
        public void _print(String s)
        {
            System.out.println(s);
        }    public void _println()
        {
            System.out.println("other method");
        }
    }testMian.java是执行类
    package test;public class testMian
    {
        public static void main(String []args)
        {
            testImp t = new testImp();
            t._print("test");
            t._println();
        }
    }如果想详细了解interface请到www.bruceeckel.com拜读thinking in java如果想继续交流[email protected]
      

  2.   

    不就是implements吗?为什么不能?