Package Creational.FactoryMethod
Class ConcreteCreatorB
java.lang.Object
Creational.FactoryMethod.Creator
Creational.FactoryMethod.ConcreteCreatorB
Concrete implementation of the Creator class.
ConcreteCreatorB is responsible for creating instances of ConcreteProductB.
It overrides the factory method (`createProduct`) to instantiate and return
the specific product type (ConcreteProductB).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFactory method implementation for creating ConcreteProductB.Methods inherited from class Creational.FactoryMethod.Creator
someOperation
-
Constructor Details
-
ConcreteCreatorB
public ConcreteCreatorB()Default constructor for ConcreteCreatorB.
-
-
Method Details
-
createProduct
Factory method implementation for creating ConcreteProductB. This method overrides the abstract factory method in the Creator class to provide a specific implementation that returns an instance of ConcreteProductB.- Specified by:
createProductin classCreator- Returns:
- A new instance of ConcreteProductB.
-