Now, we will now get to know the Prototype Design Pattern.
The Prototype design pattern is used to specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. The concept is to copy an existing object rather than creating a new instance from scratch, something that may include costly operations. The existing object acts as a prototype and contains the state of the object.
Via a real life example, you will learn how and when the Prototype design pattern should be used and how to structure your code in order to implement it. You will see how it can lead to elegant solutions to code problems.