कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Consider the Java statements int x = 10; x = x++ + x--; followed by printing x. Which value is shown?
सही उत्तर: घ) 21
x++ yields 10 (x becomes 11), x-- yields 11 (x becomes 10), and the sum 21 is then assigned to x. Java evaluates operands left to right.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a Java class with the overloads static void f(long x) and static void f(Integer x), each printing its parameter type, what does the call f(5) print?
सही उत्तर: ग) long
Java prefers widening a primitive (int to long) over boxing (int to Integer), so f(long) is chosen.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: int[][] m = new int[3][4]; System.out.println(m.length + " " + m[0].length); ?
सही उत्तर: ख) 3 4
m.length is the number of rows (3) and m[0].length is the number of columns in a row (4).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Java evaluates System.out.println(1 / 2.0 + 1 / 2); and displays which value?
सही उत्तर: क) 0.5
1 / 2.0 = 0.5 (floating point) and 1 / 2 = 0 (integer division), so 0.5 + 0 = 0.5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: long x = Integer.MAX_VALUE; x++; System.out.println(x); ?
सही उत्तर: घ) 2147483648
x is a long, so incrementing 2147483647 does not overflow and gives 2147483648.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: String a = "Hi"; String b = new String("Hi"); System.out.println((a == b) + " " + a.equals(b)); ?
सही उत्तर: ग) false true
new String creates a separate object, so == (reference comparison) is false, while equals() compares contents and is true.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, compiling the statements char c = 'A'; c = c + 1; results in:
सही उत्तर: ख) a compile-time error: possible lossy conversion from int to char
c + 1 has type int, and assigning it to a char needs an explicit cast; (c += 1 would compile because compound assignment casts automatically).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: String s = "Nepal"; System.out.println(s.length() + s.indexOf('p')); ?
सही उत्तर: क) 7
length() is 5 and indexOf('p') is 2; both are ints, so they are added: 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: int[] a = {3, 1, 2}; java.util.Arrays.sort(a); System.out.println(a[0] + "" + a[2]); ?
सही उत्तर: घ) 13
After sorting a = {1, 2, 3}; a[0] + "" + a[2] concatenates 1 and 3 into "13".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Mixing strings and arithmetic in Java, the statement System.out.println("5" + 3 * 2); outputs:
सही उत्तर: ग) 56
* is evaluated first (3 * 2 = 6), then "5" + 6 performs string concatenation: 56.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।