Java Design Pattern: Prototype
Prototype design pattern is used when very similar objects are frequently created. Prototype pattern clones objects and set the changed feature. In this way, less resources are consumed. 1. Prototype Pattern Class Diagram 2. Prototype Pattern Java Example package designpatterns.prototype; //prototype interface Prototype { void setSize(int x); void printSize(); } // a concrete … Read more