Question

What happens if you try to append a String to a StringBuffer if the resulting new...

What happens if you try to append a String to a StringBuffer if the resulting new string exceeds the capacity of the StringBuffer?

An error results and the statement fails at run time.
An error results and the statement fails at compile time.
The StringBuffer automatically increases its capacity to store the longer string.
The statement compiles and runs but the string is truncated to fit into the StringBuffer.
0 0
Add a comment Improve this question Transcribed image text
Answer #1
The StringBuffer automatically increases its capacity to store the longer string.

Add a comment
Know the answer?
Add Answer to:
What happens if you try to append a String to a StringBuffer if the resulting new...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT