logo

Crowdly

Browser

Add to Chrome

Який породжуючий патерн реалізовано   public class Pages     {         public ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Який породжуючий патерн реалізовано

  public class Pages

    {

        public int PageCount { get; set; }

        public Pages(int pageCount)

        {

            this.PageCount = pageCount;

        }

    }

    public interface IBook

    {

        string Author { get; set; }

        string Title { get; set; }

        Pages Pages { get; set; }

    }

    public class Book : IBook, ICloneable

    {

        public string Title { get; set; }

        public string Author { get; set; }

        public Pages Pages { get; set; }

        public Book(string title, string author, int pageCount)

        {

            Title = title;

            Author = author;

            Pages = new Pages(pageCount);

        }

        public Book DeepClone()

        {

            Book clone = (Book)this.MemberwiseClone();

            clone.Title = String.Copy(Title);

            clone.Author = String.Copy(Author);

            clone.Pages = new Pages(Pages.PageCount);

            return clone;

        }

        public object Clone()

        {

            return this.MemberwiseClone();

        }

    }

0%
0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome