प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In Java, a method declared static:
सही उत्तर: घ) belongs to the class and can be called without creating an object
Static methods are called using the class name, like Math.sqrt(), without an instance.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, exceptions such as IOException, which the compiler forces a method to catch or declare with throws, are called:
सही उत्तर: क) checked exceptions
Checked exceptions are verified at compile time; RuntimeException subclasses are unchecked.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the number of elements in an array arr is obtained using:
सही उत्तर: क) arr.length
For arrays, length is a field, not a method; String uses length() and collections use size().
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the default value of an uninitialised boolean instance variable is:
सही उत्तर: ग) false
Instance fields get defaults: 0 for numbers, false for boolean and null for references.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the char data type occupies:
सही उत्तर: घ) 16 bits (2 bytes)
Java's char is a 16-bit Unicode (UTF-16) code unit.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, to compare the contents (characters) of two String objects s1 and s2, you should use:
सही उत्तर: ग) s1.equals(s2)
== compares references (whether they are the same object); equals() compares the actual characters.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C++ STL container provides a dynamic array that grows automatically?
सही उत्तर: घ) vector
std::vector stores elements contiguously and resizes itself as elements are added.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, which of the following cannot be declared virtual?
सही उत्तर: घ) A constructor
Constructors cannot be virtual because the object's type is being established when they run; destructors can and often should be virtual.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A good object-oriented design aims for:
सही उत्तर: क) high cohesion and low coupling
Each class should do one focused job (high cohesion) and depend little on others (low coupling).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Inheritance that combines two or more types of inheritance (for example multiple and multilevel) is called:
सही उत्तर: घ) hybrid inheritance
Hybrid inheritance is any mixture of the basic inheritance types.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।