In OOP, what does the term "method signature" refer to?
2025
In OOP, what does the term "method signature" refer to?
- A.
The name of the method
- B.
The return type of the method
- C.
The parameters of the method
- D.
The combination of method name and parameter types
Attempted by 356 students.
Show answer & explanation
Correct answer: D
In Object-Oriented Programming (OOP), a method signature refers to the combination of the method name and the types of its parameters. It is used to uniquely identify a method, especially in cases of method overloading where multiple methods have the same name but different parameter lists. The return type is not part of the method signature, as it does not affect method identification.
हिन्दी उत्तर: ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग (OOP) में, मेथड सिग्नेचर मेथड के नाम और उसके पैरामीटर के प्रकार का संयोजन होता है। यह विशेष रूप से मेथड ओवरलोडिंग के मामले में एक मेथड को अद्वितीय रूप से पहचानने के लिए उपयोग किया जाता है, जहाँ एक ही नाम वाली कई मेथड्स अलग-अलग पैरामीटर सूचियों के साथ होती हैं। रिटर्न टाइप मेथड सिग्नेचर का हिस्सा नहीं होता है, क्योंकि यह मेथड पहचान को प्रभावित नहीं करता है।