Advertisement
jaVer404

level12.lesson09.task03

May 13th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package com.javarush.test.level12.lesson09.task03;
  2.  
  3. /* Fly, Run, Swim для классов Dog, Fish, Bird, Airplane
  4. Есть public интерфейсы Fly(летать), Run(бежать/ездить), Swim(плавать).
  5. Добавь эти интерфейсы классам Dog(собака), Fish(рыба), Bird(птица), Airplane(самолет).
  6. */
  7.  
  8. public class Solution
  9. {
  10.     public static void main(String[] args)
  11.     {
  12.  
  13.     }
  14.  
  15.     public interface Fly
  16.     {
  17.         public void fly();
  18.     }
  19.  
  20.     public interface Run
  21.     {
  22.         public void run();
  23.     }
  24.  
  25.     public interface Swim
  26.     {
  27.         public void swim();
  28.     }
  29.  
  30.     public  class Dog implements Run, Swim
  31.     {
  32.  
  33.         public void run(){}
  34.         public void swim(){}
  35.     }
  36.  
  37.     public  class Fish implements Swim
  38.     {
  39.  
  40.        public void swim(){}
  41.     }
  42.  
  43.     public  class Bird implements Fly, Run, Swim
  44.     {
  45.         public void fly(){}
  46.         public void run(){}
  47.         public void swim(){}
  48.     }
  49.  
  50.     public  class Airplane implements Fly, Run
  51.     {
  52.         public void fly(){}
  53.         public void run(){}
  54.  
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement