GIAC
GSSP-JAVA · Question #157
GSSP-JAVA Question #157: Real Exam Question with Answer & Explanation
Sign in or unlock GSSP-JAVA to reveal the answer and full explanation for question #157. The question stem and answer options stay visible for context.
Question
Mark works as a Software Developer for ZenTech Inc. He writes the following code. 1. public class Ques0352 { 2. public static void main(String[] args) { 3. String s1="JavaObject"; 4. String s1="ObjectJava"; 5. String s2="ObjectJava"; 6. if(s2.equals(s1)) 7. { System.out.println("Equal"); } 8. else 9. { System.out.println("Unequal"); } 10. } 11. } Which of the following will happen to the code when he attempts to compile and run it?
Options
- AIt will compile successfully and Unequal will be displayed as output.
- BIt will give a compile-time error at line 3.
- CIt will compile successfully and Equal will be displayed as output.
- DIt will give a compile-time error at line 4.
Unlock GSSP-JAVA to see the answer
You've previewed enough free GSSP-JAVA questions. Unlock GSSP-JAVA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.