What is named factory and default constructors?

A named constructor can only generate the instance of the current class. A factory constructor can decide which instance to return on runtime, it can return either the instance of the current class or any of the instances of its descendants class.

Sizin İçin Seçtik  Can parameters be optional?

Leave a Reply

Your email address will not be published. Required fields are marked *

What is named factory and default constructors?

A named constructor can only generate the instance of the current class. A factory constructor can decide which instance to return on runtime, it can return either the instance of the current class or any of the instances of its descendants class.

Sizin İçin Seçtik  Tüketicilerin fiyat ve kalite karşılaştırması yaparak satın aldıkları ürünlere ne denir?

Leave a Reply

Your email address will not be published. Required fields are marked *