JAVA中implements的用法

implements使用

interface Sport {

      void run();

      void jump();

}

class Athlete implements Sport {

          public void run() {

            System.out.println("短跑");

         }

         public void jump() {

            System.out.println("跳高");

         }

         public static void main(String[] args) {

          Ahtlete al=new Ahtlete();

                al.run();

                al.jump();

          }

}

原文地址:https://www.cnblogs.com/Logo-TPM/p/6147798.html