Advertisement
jaVer404

level12.lesson12.home07

May 13th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. package com.javarush.test.level12.lesson12.home07;
  2.  
  3. /* Fly, Run, Swim для классов Duck, Penguin, Toad
  4. Есть интерфейсы Fly(летать), Swim(плавать), Run(бегать).
  5. Добавь эти интерфейсы классам Duck(утка), Penguin(пингвин), Toad(жаба)
  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 Duck implements Run, Fly, Swim
  31.     {
  32.         public void run() {}
  33.         public void fly(){}
  34.         public void swim(){}
  35.     }
  36.  
  37.     public class Penguin implements Run, Swim
  38.     {
  39.         public void run() {}
  40.         public void swim(){}
  41.     }
  42.  
  43.     public class Toad implements Swim
  44.     {
  45.         public void swim(){}
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement