कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In Java, a class has the overloaded methods static void f(int x) and static void f(double x), each printing its parameter type. What is printed by the call f('A')?
सही उत्तर: क) int
There is no f(char), so the char is widened; widening to int is preferred over widening to double, so f(int) is called.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: int x = 3; x += x++ * 2; System.out.println(x);
सही उत्तर: घ) 9
x += e means x = x + e; the left x is read as 3, x++ yields 3 so e = 6, and the result 9 is assigned, overwriting the increment.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: System.out.println(new StringBuilder("ac").insert(1, "b"));
सही उत्तर: ग) abc
insert(1, "b") places "b" at index 1, between 'a' and 'c', giving "abc".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: String s = null; System.out.println(s + "x");
सही उत्तर: ख) nullx
In string concatenation a null reference is converted to the text "null", so the result is "nullx".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: System.out.println(Integer.MAX_VALUE + 1);
सही उत्तर: क) -2147483648
Java int arithmetic wraps around silently on overflow, so MAX_VALUE + 1 becomes MIN_VALUE, -2147483648.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: System.out.println((char)('a' + 2));
सही उत्तर: घ) c
'a' + 2 is the int 99, and casting it to char gives 'c'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: System.out.println(10 == 10.0);
सही उत्तर: ग) true
The int 10 is promoted to double 10.0 before comparison, so the values are equal and true is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: int[] a = {1, 2, 3}; int[] b = a; b[0] = 9; System.out.println(a[0]);
सही उत्तर: ख) 9
b = a copies only the reference, so a and b refer to the same array; changing b[0] also changes a[0] to 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: System.out.println("Nepal".toUpperCase().charAt(1));
सही उत्तर: क) E
"Nepal".toUpperCase() is "NEPAL", and the character at index 1 is 'E'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this Java fragment and give its output: String s = "Kathmandu"; System.out.println(s.indexOf('a') + s.lastIndexOf('a'));
सही उत्तर: क) 6
The first 'a' is at index 1 and the last 'a' is at index 5, so the sum is 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।