प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In Java exception handling, the finally block:
सही उत्तर: घ) executes whether or not an exception is thrown in the try block
finally is used for clean-up such as closing files, and it runs after try (and any catch) in either case.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the automatic conversion of a primitive int into an Integer object, as in Integer x = 5;, is called:
सही उत्तर: ग) autoboxing
Autoboxing wraps a primitive in its wrapper class automatically; the reverse conversion is unboxing.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the statement float f = 3.14; gives a compile-time error because:
सही उत्तर: ग) 3.14 is a double literal, so it must be written as 3.14f
Floating literals are double by default, and narrowing to float needs the f suffix or an explicit cast.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many bits does a variable of the Java primitive type byte occupy?
सही उत्तर: क) 8
A Java byte is a signed 8-bit integer with range -128 to 127.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which JDK tool compiles Java source files (.java) into bytecode?
सही उत्तर: क) javac
javac is the Java compiler; the java command then runs the resulting .class files on the JVM.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++ protected inheritance (class D : protected B), the public members of B become:
सही उत्तर: घ) protected members of D
With protected inheritance, public and protected members of the base class both become protected in the derived class.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, declaring a single-argument constructor as explicit:
सही उत्तर: ख) prevents it from being used for implicit type conversions
explicit stops the compiler from silently converting a value into the class type using that constructor.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The C++ STL container std::map stores its elements as:
सही उत्तर: क) key-value pairs kept sorted by key
std::map is an associative container (usually a balanced tree) holding unique keys in sorted order with associated values.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, const data members and reference members of a class must be initialised:
सही उत्तर: ग) in the constructor's member initializer list
const and reference members cannot be assigned after creation, so they must be initialised in the initializer list, e.g. A() : x(5) { }.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, when a class has a pointer member that owns dynamically allocated memory, the compiler-generated copy constructor is a problem because it performs a:
सही उत्तर: ग) shallow copy, so both objects end up pointing to the same memory
The default copy is member-wise, copying only the pointer value; a user-defined copy constructor is needed to make a deep copy.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।