प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Which design pattern defines a one-to-many dependency so that when one object changes state all its dependents are notified automatically?
सही उत्तर: क) Observer
In the Observer pattern, subscribers register with a subject and are notified of its changes.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Single Responsibility Principle of object-oriented design states that a class should:
सही उत्तर: ख) Have only one reason to change
Each class should be responsible for one part of the functionality, which keeps it focused and easier to maintain.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the synchronized keyword is used to:
सही उत्तर: घ) Let only one thread at a time execute a method or block that uses the same object's lock
synchronized provides mutual exclusion using an object's monitor lock, preventing race conditions on shared data.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Java's slogan 'Write Once, Run Anywhere' refers to its:
सही उत्तर: क) Platform independence through bytecode run on a JVM
Compiled Java bytecode runs on any platform that has a Java Virtual Machine.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Java Runtime Environment (JRE) consists of:
सही उत्तर: ग) The JVM together with the core class libraries needed to run programs
The JRE runs Java programs; the JDK adds development tools such as javac on top of it.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Java class Scanner, commonly used to read keyboard input, belongs to the package:
सही उत्तर: ग) java.util
Scanner is java.util.Scanner, so programs need import java.util.Scanner;.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which Java package is imported automatically into every Java source file?
सही उत्तर: क) java.lang
java.lang (String, Math, System, Object, etc.) is always available without an import statement.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, evaluating the integer expression 10 / 0 at run time:
सही उत्तर: ख) Throws an ArithmeticException
Integer division by zero throws ArithmeticException; floating-point 10.0 / 0 gives Infinity instead.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Java primitive type short occupies:
सही उत्तर: घ) 16 bits
Java fixes the sizes: byte 8, short 16, int 32 and long 64 bits.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, a method that overrides a superclass method:
सही उत्तर: घ) Cannot have a more restrictive access modifier than the method it overrides
For example a public method cannot be overridden by a protected one, since that would break substitutability.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।