Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
Simulate an object manufacturing plant. See how the Factory Pattern decouples your input logic from object creation using polymorphism.
Select a role to manufacture an object via the UserFactory.
🛑 Polymorphism in Action: Notice how the return type is always User, but the actual objects on the heap are specific subclasses. The calling code doesn't care about the difference!