✏️ Explanatory Question

Give the output of the following program

👁 27 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation


class MainString
{
    public static void main(String args[])
    {
        StringBuffer s = new StringBuffer("String");

        if (s.length() > 5 && s.append("Buffer").toString().equals("X"))
        {
            // empty statement
        }

        System.out.println(s);
    }
}

Output:


StringBuffer