CSS font stacks & developer FAQs with Web standards
Site navigation below

One of hundreds of answers available with our premium content service.

Part answer

A: A factory method is typically used to obtain a new instance of a class, which may be one of several alternate implementations. The return type of a factory method is an interface or superclass type, which gives it the freedom to govern the actual class that is returned through polymorphism. This design pattern enables the factory to control and encapsulate the logic used to decide which instance to return.

… full answer hidden

Click for full answers

Premium members click below for full answer
What is a factory method?

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager