Multiple choice technology web technology

What is the output of the following StringBuffer sb1 = new StringBuffer("Amit"); StringBuffer sb2= new StringBuffer("Amit"); String ss1 = "Amit"; System.out.println(sb1==sb2); System.out.println(sb1.equals(sb2)); System.out.println(sb1.equals(ss1)); System.out.println("Poddar".substring(3));

  1. false false false dar

  2. false true false Poddar

  3. Compiler Error

  4. true true false dar

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is identical to question 141947. StringBuffer does not override equals(), so sb1.equals(sb2) returns false for different objects. sb1==sb2 is also false. StringBuffer cannot equal a String. "Poddar".substring(3) returns "dar".