Question: Predict the output? 1. public class 2. public static void024 muya0 main(String[] args) { 3. String s2=null; 4. if (s2 == null) { 5.
Predict the output? 1. public class 2. public static void024 muya0 main(String[] args) { 3. String s2="null"; 4. if (s2 == null) { 5. But print/true") 2-JAN-2024 6.) 7.} 8.} u.divya01 2024 O Code I compile successfully and prints "true" O Code will not be compiled due to error in line4 UESTIONS thumu.divya0 thumu.divya01 thumu.divyaQ1 Code will compile successfully and will not print anything in the console Null pointer exception will be thrown during runtime in line-4
Step by Step Solution
There are 3 Steps involved in it
Answer The provided code has a syntax error in line 4 where th... View full answer
Get step-by-step solutions from verified subject matter experts
