@@ -0,0 +1,1401 @@
+package com.javarush.task.task21.task2108;%0A%0A/* %0A%D0%9A%D0%BB%D0%BE%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5 %D1%80%D0%B0%D1%81%D1%82%D0%B5%D0%BD%D0%B8%D0%B9%0A*/%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) %7B%0A        Tree tree = new Tree(%22willow%22, new String%5B%5D%7B%22s1%22, %22s2%22, %22s3%22, %22s4%22%7D);%0A        Tree clone = null;%0A        try %7B%0A            clone = tree.clone();%0A        %7D catch (CloneNotSupportedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        System.out.println(tree);%0A        System.out.println(clone);%0A%0A        System.out.println(tree.branches);%0A        System.out.println(clone.branches);%0A    %7D%0A%0A    public static class Plant%7B%0A        private String name;%0A%0A        public Plant(String name) %7B%0A            this.name = name;%0A        %7D%0A%0A        public String getName() %7B%0A            return name;%0A        %7D%0A    %7D%0A%0A    public static class Tree extends Plant implements Cloneable %7B%0A        private String%5B%5D branches;%0A%0A        public Tree(String name, String%5B%5D branches) %7B%0A            super(name);%0A            this.branches = branches;%0A        %7D%0A%0A        public String%5B%5D getBranches() %7B%0A            return branches;%0A        %7D%0A%0A        @Override%0A        protected Tree clone() throws CloneNotSupportedException %7B%0A            String%5B%5D strings = new String%5Bbranches.length%5D;%0A            for (int i=0;i%3Cbranches.length;i++) %7B%0A                strings%5Bi%5D = branches%5Bi%5D;%0A            %7D%0A%0A            return new Tree(super.getName(), strings);%0A        %7D%0A    %7D%0A%7D%0A

Task --> 2108