What is the result of compiling and running the followingcode?class Tester { public static void main(String args[]) { String s1 = null; String s2 = null; if(s1 == s2) System.out.print("A"); if(s1.equals(s2)) System.out.print("B"); }}
"A" will be printed
No output is produced
"B" will be printed
"A" will be printed followed by a NullPointerExceptionthrown
"AB" will be printed
What is the result of compiling and running the following code? class Tester { public static void main(String args[]
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am