Question 60Asked in Bihar STET Paper 2 Computer Science (Class 11-12), 12 Sep 2023, Shift 1 + 2 more papers

What is the main purpose of inheritance in OOP?OOP में इनहेरिटेंस का मुख्य उद्देश्य क्या है?

OOP में इनहेरिटेंस का मुख्य उद्देश्य क्या है?
  1. ATo create instances of classesक्लास के इंस्टैंस बनाना
  2. BTo prevent data abstractionडेटा एब्सट्रैक्शन को रोकना
  3. CTo establish a parent-child relationship between classesक्लास के बीच पैरेंट-चाइल्ड रिलेशनशीप स्थापित करना
  4. DTo define exceptionsएक्सेप्शन को परिभाषित करना
Show answerHide answer

Correct answer: (C) To establish a parent-child relationship between classesक्लास के बीच पैरेंट-चाइल्ड रिलेशनशीप स्थापित करना

Explanation

Inheritance creates a parent-child (is-a) relationship, so a subclass reuses and extends the members of its parent class.Inheritance पैरेंट-चाइल्ड (is-a) संबंध बनाती है, जिससे सबक्लास अपने पैरेंट क्लास के सदस्यों को दोबारा उपयोग और विस्तारित करती है।

From Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 1

This is question 60 of Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 1. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.

Asked in 3 papers