1. Factory Method solves which problem in object creation?
Factory Method lets a base class call a creation hook while subclasses decide the concrete type. This removes explicit new calls from high-level code. It improves testability and keeps open–closed extension. You add a new product by adding a new subclass, not by changing callers.
interface Transport { deliver(): void }
abstract class Logistics { factory(): Transport; }
class ShipLogistics extends Logistics { factory(){ return new Ship(); } }