What does Liskov substitution principle specify?
(a) parent class can be substituted by child class
(b) child class can be substituted by parent class
(c) parent class cannot be substituted by child class
(d) No classes can be replaced by each other
(a) parent class can be substituted by child class
(b) child class can be substituted by parent class
(c) parent class cannot be substituted by child class
(d) No classes can be replaced by each other
The correct answer is (a) parent class can be substituted by child class
Explanation: Liskov substitution principle states that Objects in a program should be replaceable with instances of their sub types without altering the correctness of that program.