import java.lang.*; class A { public static void main(String[] args) { StringBuilder s1="TCS"; String s2=new String("TCS"); System.out.println(s1==s2); System.out.println(s1.equals(s2)); } } What is the Result?
-
true false
-
false true
-
Compile Error
-
false false
C
Correct answer
Explanation
This code fails to compile because StringBuilder cannot be initialized with a String literal using the = operator. StringBuilder s1 = 'TCS' is a type mismatch - StringBuilder requires explicit construction via new StringBuilder(). The code won't reach runtime.