Question:
A/An ______ is a user-defined datatype which has data members and member functions.
______ एक यूज़र-डिफ़ाइंड डेटाटाइप है जिसमें डेटा मेंबर्स और मेंबर फंक्शन शामिल होते हैं।
Options:
- class
- object
- package
- method
- क्लास (class)
- ऑब्जेक्ट (object)
- पैकेज (package)
- मेथड (method)
Correct Answer: a)
Explanation:
In Object-Oriented Programming (OOP) languages such as C++, Java, and C#:
– A class is a user-defined data type (or blueprint) that binds together data members (variables/attributes) and member functions (methods) into a single entity.
– An object is an instance of a class, taking up physical memory.
– A method is a function declared within a class.
– A package is a namespace or folder grouping related classes and interfaces.
Therefore, the user-defined data type containing data members and member functions is a class.
Hence, option 1 (‘class’) is the correct answer.
ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग (OOP) जैसे C++, जावा आदि में:
– क्लास (Class) एक यूजर-डिफाइंड डेटा टाइप (user-defined datatype) है, जो डेटा मेंबर्स (variables) और मेंबर फंक्शन्स (methods) को एक इकाई में बांधती है।
– ऑब्जेक्ट (Object) क्लास का एक इंस्टेंस (उदाहरण) होता है।
– मेथड (Method) क्लास के भीतर परिभाषित फलन (function) होता है।
– पैकेज (Package) संबंधित क्लासों का एक समूह होता है।
अतः वह यूजर-डिफाइंड डेटाटाइप जिसमें डेटा मेंबर्स और मेंबर फंक्शन होते हैं, क्लास कहलाती है।
अतः सही उत्तर विकल्प 1 (‘क्लास’) है।