Intent
Prototype is a creational design pattern that lets you copy existing objects without making your code dependent on their classes.

The Problem
Imagine you have something, like a thing, and you want to make an exact copy of it. How do you do that? Well, first, you need to make a new thing that’s just like the original one. Then, you have to look at all the parts of the original thing and make sure the new thing has the same stuff in it.
But here’s the tricky part. You can’t always copy things this way because some of the stuff inside the thing might be hidden and not easy to see from the outside.
There’s another problem with this method. You have to know exactly what kind of thing you’re copying to make a new one. So, your code depends on that specific kind of thing. But what if you only know what the thing does, not what it’s called? Like, you know it follows certain rules, but you don’t know its exact name. That can make things even trickier.

The Solution
The Prototype pattern is a way to make copies of objects easily. Each object that can be copied follows a common rule. This rule has a special method called “clone” that makes a duplicate of the object. You don’t need to know exactly what kind of object it is; you just use the “clone” method.
The “clone” method works the same way in all objects. It makes a new object that’s the same as the old one, copying all the values inside it, even if they are hidden (private). This is helpful when you have complex objects with lots of parts, and you want to make new ones that are similar without starting from scratch.
We call an object that can be cloned a “prototype.” So, instead of creating a new object from the beginning, you can just clone a prototype that matches what you need. This can be really useful when you have objects with many different settings and options.
