Advertisement
jaVer404

level12.lesson12.bonus02

May 14th, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. package com.javarush.test.level12.lesson12.bonus02;
  2.  
  3. /* Нужно добавить в программу новую функциональность
  4. Сделать класс Pegas(пегас) на основе класса Horse(лошадь) и интерфейса Fly(летать).
  5. */
  6.  
  7. public class Solution
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Pegas horse = new Pegas();
  12.     }
  13.  
  14.     public static interface Fly
  15.     {
  16.         public void fly();
  17.     }
  18.  
  19.     public static class Horse
  20.     {
  21.         public void run()
  22.         {
  23.  
  24.         }
  25.     }
  26.  
  27.     public static class Pegas extends Horse implements Fly
  28.     {
  29.         public void fly() {}
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement