DSSSB TGT CS Mock 03 – Question 174

Question:

In object-oriented programming, what principle states that ‘objects of a superclass should be replaceable with objects of its subclasses without breaking application correctness’?
ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग में कौन सा सिद्धांत कहता है कि ‘सुपरक्लास के ऑब्जेक्ट्स को एप्लिकेशन की शुद्धता को तोड़े बिना इसके सबक्लास के ऑब्जेक्ट्स से प्रतिस्थापित किया जा सकता है’?

Options:

  • Liskov Substitution Principle (LSP)
  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Interface Segregation Principle (ISP)
  • लिस्कोव प्रतिस्थापन सिद्धांत (LSP)
  • एकल जिम्मेदारी सिद्धांत (SRP)
  • ओपन/क्लोज्ड सिद्धांत (OCP)
  • इंटरफ़ेस पृथक्करण सिद्धांत (ISP)

Correct Answer: a)

Explanation:

The Liskov Substitution Principle (the ‘L’ in SOLID) states that if \(S\) is a subtype of \(T\), objects of type \(T\) may be replaced with objects of type \(S\) without altering any desirable properties of the program.
SOLID का ‘L’ यानी Liskov Substitution Principle यह सुनिश्चित करता है कि सबक्लास अपने पैरेंट क्लास के व्यवहार और अनुबंध का पूर्ण सम्मान करे।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top