प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C++, a static member function of a class:
सही उत्तर: ग) has no this pointer and can directly access only static members
Static member functions belong to the class rather than to any object, so there is no this pointer.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, the size of an object of an empty class (one with no data members) is:
सही उत्तर: क) 1 byte
C++ gives every object a distinct address, so even an empty class has a size of at least 1 byte.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, a member function declared as void show() const; :
सही उत्तर: ख) cannot modify the data members of the object (except mutable ones)
The const qualifier makes this a pointer to const inside the function, so ordinary data members cannot be changed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, the handler catch (...) will:
सही उत्तर: क) catch an exception of any type
The ellipsis in catch (...) is a catch-all handler that matches any thrown exception.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
C++ templates mainly support which style of programming?
सही उत्तर: ग) Generic programming
Templates let one function or class be written once and work with many data types.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a UML class diagram, a minus sign (-) placed before an attribute indicates that it is:
सही उत्तर: घ) private
UML visibility symbols are + public, - private, # protected and ~ package.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a UML class diagram, a class is drawn as a rectangle divided into three compartments, which show:
सही उत्तर: ख) the class name, its attributes and its operations
The top part holds the class name, the middle its attributes (fields) and the bottom its operations (methods).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Public getter and setter methods that read and change private data members mainly support which OOP principle?
सही उत्तर: क) Encapsulation
Accessor and mutator methods allow controlled access to hidden data, which is the essence of encapsulation.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Singleton design pattern ensures that a class:
सही उत्तर: क) has only one instance and provides a global point of access to it
A singleton hides its constructor and returns the same single object each time it is requested.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Open/Closed Principle in object-oriented design says that software modules should be:
सही उत्तर: घ) open for extension but closed for modification
New behaviour should be added by extending existing code (for example through subclasses) rather than editing tested code.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।