Class ConcretePrototype2

java.lang.Object
Creational.Prototype.ConcretePrototype2
All Implemented Interfaces:
Prototype

public class ConcretePrototype2 extends Object implements Prototype
Another concrete implementation of the Prototype interface. Represents a prototype with an integer attribute.
  • Constructor Details

    • ConcretePrototype2

      public ConcretePrototype2(int attribute)
      Constructor to initialize the attribute.
      Parameters:
      attribute - The value to initialize the prototype's attribute.
  • Method Details

    • clone

      public Prototype clone()
      Description copied from interface: Prototype
      Creates a clone of the current object.
      Specified by:
      clone in interface Prototype
      Overrides:
      clone in class Object
      Returns:
      A new object that is a copy of the current object.
    • display

      public void display()
      Description copied from interface: Prototype
      Displays the details of the prototype.
      Specified by:
      display in interface Prototype