Рет қаралды 9,056
The infamous Square-Rectangle Problem is a great way to understand why Liskov's Substitution Principle is important. Do you know the answer to the problem?
00:00 The Problem
01:08 Defining Rectangle
01:35 Using Rectangle
02:16 Defining Square
02:37 Using Square
03:27 Overriding methods
04:39 Violating the super type
09:09 Question
09:27 Takeaway