Advertisement
jaVer404

level15.lesson02.task01

Jun 26th, 2015
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. package com.javarush.test.level15.lesson02.task01;
  2.  
  3. /* ООП - Расставить интерфейсы
  4. 1. Добавить все возможные интерфейсы из Movable, Sellable, Discountable в класс Clothes.
  5. 2. Реализовать их методы.
  6. */
  7.  
  8. public class Solution {
  9.     public static interface Movable {
  10.         boolean getAllowedAction(String name);
  11.     }
  12.  
  13.     public static interface Sellable {
  14.         Object getAllowedAction(String name);
  15.     }
  16.  
  17.     public static interface Discountable {
  18.         Object getAllowedAction();
  19.     }
  20.  
  21.     public static class Clothes implements Sellable, Discountable {
  22.  
  23.         public Object getAllowedAction(String name) {
  24.             return new Object();
  25.         }
  26.  
  27.         public Object getAllowedAction() {
  28.             return new Object();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement