Multiple choice technology programming languages

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?

  1. true false

  2. false true

  3. Compile Error

  4. false false

Reveal answer Fill a bubble to check yourself
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.