Subscribe to Java/SCJP        RSS Feed
-----

Prototype Pattern

Icon Leave Comment
The prototype pattern is used in cases where the cost of creating a new object is much more than simply editing the attributes of an already existing object. So this pattern should be used when one has the privileges to modify the desired attributes of the object.
In java, the prototype of an object can be got by using the clone method. The method returns a new copy of the object if the class implements a marker interface named cloneable.

0 Comments On This Entry

 

January 2022

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
3031     

Recent Entries

Recent Comments

Search My Blog

11 user(s) viewing

11 Guests
0 member(s)
0 anonymous member(s)