Advertisement
jaVer404

level12.lesson12.home08

May 13th, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. package com.javarush.test.level12.lesson12.home08;
  2.  
  3. /* Интерфейсы к классу Human
  4. Добавь как можно больше интерфейсов к классу Human, но чтобы он не стал абстрактным классом.
  5. Добавлять методы в класс Human запрещается.
  6. */
  7.  
  8. public class Solution
  9. {
  10.     public static void main(String[] args)
  11.     {
  12.         Human human = new Human();
  13.         System.out.println(human);
  14.     }
  15.  
  16.     public static interface Worker
  17.     {
  18.         public void workLazy();
  19.     }
  20.  
  21.     public static interface Businessman
  22.     {
  23.         public void workHard();
  24.     }
  25.  
  26.     public static interface Secretary
  27.     {
  28.         public void workLazy();
  29.     }
  30.  
  31.     public static interface Miner
  32.     {
  33.         public void workVeryHard();
  34.     }
  35.  
  36.     public static class Human implements Businessman, Worker, Secretary
  37.     {
  38.  
  39.         public void workHard()
  40.         {
  41.         }
  42.  
  43.         public void workLazy()
  44.         {
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement