Question 59Asked in Bihar STET 2024 Paper II Computer Science, 11 Jun 2024, Shift 2 (3:00 PM)

In OOP, what is the purpose of the "this" keyword?ओओपी में, "इस" कीवर्ड का उद्देश्य क्या है?

ओओपी में, "इस" कीवर्ड का उद्देश्य क्या है?
  1. ATo create a new instance of a classएक वर्ग का एक नया उदाहरण बनाने के लिए
  2. BTo refer to the superclassसुपरक्लास को संदर्भित करने के लिए
  3. CTo call a static methodएक स्थिर विधि को कॉल करना
  4. DTo refer to the current instance of a classएक वर्ग के वर्तमान उदाहरण को संदर्भित करना
Show answerHide answer

Correct answer: (D) To refer to the current instance of a classएक वर्ग के वर्तमान उदाहरण को संदर्भित करना

Explanation

In OOP, 'this' is a reference to the current object, the instance whose method is running. It is used, for example, to tell fields apart from parameters with the same name.OOP में 'this' वर्तमान ऑब्जेक्ट का संदर्भ है, यानी वह instance जिसका method चल रहा है। इसका उपयोग, उदाहरण के लिए, उसी नाम वाले fields और parameters में अंतर करने के लिए होता है।

From Bihar STET 2024 Paper II Computer Science PYQ, 11 Jun 2024, Shift 2 (3:00 PM)

This is question 59 of Bihar STET 2024 Paper II Computer Science PYQ, 11 Jun 2024, Shift 2 (3:00 PM). 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.