KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
It was an interview question. I was asked to implement the StringBuffer append function. I saw the code after the interview. But I cannot understand how the operation is done with creation of a single object. I am thinking like this. String s = "orange"; s.append("apple"); Here two objects are created. But StringBuilder s = new StringBuilder("Orange"); s.append("apple"); Now here only one object is created. How is Java doing this operation?
Tags (comma-separated)
Save Edits
Cancel