//I made known to them your name, and will make it known; that the love with which you loved me may be in them, and I in them. (John 17:26) package com.javarush.task.task18.task1811; /* Wrapper (Decorator) */ public class Solution { public static void main(String[] args) { new Thread(new DecoratorRunnableImpl(new DecoratorMyRunnableImpl(new RunnableImpl()))).start(); } public static class RunnableImpl implements Runnable { @Override public void run() { System.out.println("RunnableImpl body"); } } public static class DecoratorRunnableImpl implements Runnable { private Runnable component; public DecoratorRunnableImpl(Runnable component) { this.component = component; } @Override public void run() { System.out.print("DecoratorRunnableImpl body "); component.run(); } } public static class DecoratorMyRunnableImpl implements Runnable { private Runnable component; public DecoratorMyRunnableImpl(Runnable component) { this.component = component; } @Override public void run() { System.out.print("DecoratorMyRunnableImpl body "); component.run(); } } } /* Wrapper (Decorator) РазбеÑиÑÑ, ÑÑо Ð´ÐµÐ»Ð°ÐµÑ Ð¿ÑогÑамма. ÐналогиÑно клаÑÑÑ DecoratorRunnableImpl Ñоздай клаÑÑ DecoratorMyRunnableImpl. ТÑебованиÑ: 1.âСоздай клаÑÑ DecoratorMyRunnableImpl, аналогиÑнÑй DecoratorRunnableImpl. 2.âÐоÑле запÑÑка, каждÑй клаÑÑ Ð´Ð¾Ð»Ð¶ÐµÐ½ вÑвеÑÑи в конÑÐ¾Ð»Ñ "'ÐÐ¼Ñ ÐºÐ»Ð°ÑÑа' body". 3.âÐлаÑÑÑ RunnableImpl и DecoratorRunnableImpl изменÑÑÑ Ð½ÐµÐ»ÑзÑ. 4.âÐеÑод main изменÑÑÑ Ð½ÐµÐ»ÑзÑ. */