Question:

What is the output of this program?
What is the output of this program?
Question:

What is the output of this program?
What is the output of this program?
What is the output of this program? / इस प्रोग्राम का आउटपुट क्या है?

What is the output of this program? / इस प्रोग्राम का आउटपुट क्या है?
Options:
Correct Answer: a)
Explanation:
Detailed Explanation:
The correct answer is a) Compilation Error (कम्पाइलेशन एरर).
Code Examination:
class PrintTest {
public static void main(String args[])
{
int num = 10;
if (NUM < 100) {
System.out.println("The value of num is" + num);
}
}
}
Reason for Compilation Error:
int num = 10;.if (NUM < 100).NUM exists in the local or enclosing scope, the Java compiler (javac) halts with a compile-time error:error: cannot find symbol
variable NUM
location: class PrintTest
Because this fault is identified during syntax/semantic compilation before any bytecode execution can take place, the result is a Compilation Error.
विस्तृत व्याख्या:
सही उत्तर a) कम्पाइलेशन एरर (Compilation Error) है।
कोड का विश्लेषण:
class PrintTest {
public static void main(String args[])
{
int num = 10;
if (NUM < 100) {
System.out.println("The value of num is" + num);
}
}
}
त्रुटि का कारण:
int num = 10;।if की शर्त में बड़े अक्षरों वाले NUM का उपयोग किया गया है: if (NUM < 100)।NUM नाम से कोई चर घोषित नहीं किया गया है, इसलिए कंपाइलर निम्नलिखित त्रुटि देता है:error: cannot find symbol: variable NUM।