Question
According to SOLID principles, the Liskov Substitution
Principle (LSP) primarily focuses on:Solution
The Liskov Substitution Principle (LSP) ensures that derived classes (or subclasses) must be able to substitute their parent classes without affecting the behavior of the program. This principle is fundamental in object-oriented programming as it ensures that any derived class can stand in for its base class, maintaining the expected behavior. Violation of LSP usually indicates design issues, such as improper inheritance structures. Why other options are wrong: b) Open/Closed Principle : This principle emphasizes that software entities should be extendable without modifying existing code. This is not the Liskov Substitution Principle. c) Single Responsibility Principle : States that a class should only have one reason to change, which relates to the design of class responsibilities, not LSP. d) Interface Segregation Principle : Focuses on minimizing interface dependencies, but it does not relate to class substitution. e) Dependency Inversion Principle : Advocates for abstracting dependencies, focusing on design-level issues unrelated to class substitution.
All 56 students in a class are standing in a row facing north. Vivek is 25th from the right end and Suman is 12th from left end. ...
A cube is made by folding the given sheet. In the cube so formed, what would be the symbol on the opposite side of "$" symbol?
If the marks of U is better than the marks of W, then what is the rank of U in the class?
If all the alphabets of the word ‘ACTIVATE’ are replaced by immediate succeeding letter in the alphabetical series, then what is the difference betw...
Answer the questions based on the information given below.
Nine persons F, G, H, I, J, K, L, M and N are ranked according to their height. At l...
Q is older than R. N and O are of equal age. S is the youngest. P is younger than O. P is older than Q. How many persons are younger than P?
Answer the questions based on the information given below.
Nine persons R, S, T, U, V, W, X, Y and Z are ranked according to their height. At l...
R is shorter than S but taller than T. U is shorter than R but taller than T and V is shorter than S but taller than R. The shortest person is:
(1) Punishment   Â
(2) Arrest      Â
(3) Crime      Â
(4) Judgment
...How is T related to S? Â Â