← All tasks
🧮
Programming Advanced

Write a Late Static Binding Factory Method

⏱ 3 min ⭐ 90 XP 🔁 3 attempts allowed

What you'll do

Write the static method create() on a base class that returns 'new static()' so subclasses get an instance of themselves, not the base class.

Scenario

A Model base class needs a generic create() factory that subclasses like User can call and correctly get a User instance back.

Ready to try it?

Create a free account and try "Write a Late Static Binding Factory Method" free for 7 days, no card required. Earn 90 XP and track your internship progress.

Already have an account? Sign in