How to find the length and capacity of a string buffer ?

Answer Posted / vijayakumar chinnasamy

StringBuffer conatain a method called length() to find out
the length and capacity() to findout the capacity of
stringbuffer.

ex:
StringBuffer buffer=null;
buffer.length();
buffer.capacity();

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scope & storage allocation of static, local and register variables? Explain with an example.

572


What is the difference between ArrayList and Vector? which one is better in Java

613


What is an infinite loop?

555


What is java used for?

562


What are the restrictions imposed by a Security Manager on Applets?.

2075






What is the common usage of serialization? What exceptions occur during serialization?

609


How many bytes is a url?

567


Have you ever used hashtable and dictionary?

583


Does constructor return any value?

585


What is meant by method?

583


What is the full form of jpeg?

527


What are the different types of collections in java?

532


what is a working thread? : Java thread

559


Which method must be implemented by all threads?

730


Explain throw keyword in java?

620