कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Which design pattern lets classes with incompatible interfaces work together by wrapping one of them in a class that converts its interface?
सही उत्तर: ख) Adapter
An Adapter translates the interface of an existing class into the interface the client expects.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Interface Segregation Principle of object-oriented design says that:
सही उत्तर: ग) clients should not be forced to depend on methods they do not use
ISP favours several small, specific interfaces over one large general-purpose interface.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the fields declared in an interface are implicitly:
सही उत्तर: घ) public, static and final
Interface fields are constants: the compiler treats them as public static final even if the modifiers are not written.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: StringBuilder sb = new StringBuilder("abc"); sb.reverse().append("d"); System.out.println(sb); ?
सही उत्तर: घ) cbad
reverse() changes the builder to "cba" and returns it, then append("d") gives "cbad".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: String s = "abc"; s.concat("d"); System.out.println(s); ?
सही उत्तर: क) abc
concat() returns a new String; since the result is not assigned, the immutable s still refers to "abc".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: int x = 5; System.out.println(x++ + ++x); ?
सही उत्तर: ख) 12
Java evaluates operands left to right: x++ gives 5 (x becomes 6), then ++x makes x 7 and gives 7; 5 + 7 = 12.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: System.out.println('a' + 1); ?
सही उत्तर: ग) 98
A char in arithmetic is promoted to int, so 'a' (97) + 1 = 98 is printed as a number.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: System.out.println(1 + 2 + "3" + 4 + 5); ?
सही उत्तर: ग) 3345
Evaluation is left to right: 1 + 2 = 3 (numbers), then string concatenation takes over: "3" + "3" + "4" + "5".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given void f(int &x) { x *= 2; } and int a = 4;, what is printed by f(a); f(a); cout << a; ?
सही उत्तर: घ) 16
x is a reference to a, so each call doubles a itself: 4 becomes 8 and then 16.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given int add(int a, int b = 4, int c = 1) { return a + b + c; }, what is printed by cout << add(2) << add(2, 3); ?
सही उत्तर: क) 76
add(2) uses both defaults: 2 + 4 + 1 = 7; add(2, 3) uses only the default c: 2 + 3 + 1 = 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।