@@ -0,0 +1,1317 @@
+package com.javarush.task.task23.task2311;%0A%0A/* %0A%D0%9F%D0%BE%D0%B2%D1%82%D0%BE%D1%80%D1%8F%D0%B5%D0%BC threads%0A*/%0Apublic class Solution %7B%0A    public final String name;%0A    public final String food;%0A    public final String sound;%0A%0A    public Solution(String name, String food, String sound) %7B%0A        this.name = name;%0A        this.food = food;%0A        this.sound = sound;%0A    %7D%0A%0A    public void eat() %7B%0A        System.out.println(name + %22: Mmmmm, %22 + food);%0A    %7D%0A%0A    public void play() %7B%0A        System.out.println(name + %22: %22 + sound + %22 %22 + sound);%0A    %7D%0A%0A    public void sleep(long milliseconds) %7B%0A        System.out.println(name + %22: Zzzzzzz...%22 + (milliseconds / 1000) + %22 sec%22);%0A    %7D%0A%0A    public void live() throws InterruptedException %7B%0A        Thread thread = new Thread() %7B%0A            public void run() %7B%0A                try %7B%0A                    someActions();%0A                %7D catch (Exception e) %7B%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A%0A            private void someActions() throws InterruptedException %7B%0A                eat();%0A                play();%0A               Solution.this.sleep(1000);%0A            %7D%0A        %7D;%0A        thread.start();%0A        thread.join();%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A        new Solution(%22Amigo%22, %22beef%22, %22knock%22).live();%0A    %7D%0A%7D%0A

Task --> 2311