✏️ Explanatory Question

What will be the output of the following code snippet when combined with suitable declarations and run ?

👁 27 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation


StringBuffer city = new StringBuffer ("Madras");

StringBuffer string = new StringBuffer();

string.append(new String(city));

string.insert(0, "Central");

String.out.println(string);

Output:


CentralMadras.