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();

          }

}

posted on 2016-12-08 23:33  早晨de风景  阅读(7518)  评论(0编辑  收藏  举报

导航