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

How do you represent a space in regex java?

513


Can keyword be used as identifier?

541


What are static methods?

572


Explain about exception propagation?

581


Which list does not allow duplicates in java?

505






What are the differences between abstract class and interface?

506


What are the main uses of this keyword?

593


Can we serialize arraylist in java?

532


Is null an object in java?

556


Hi.... I applied for the post of scientific officer/Engineer-SB(Programmer).Please post the syllabus and sample papers.

1503


What are some characteristics of interference class?

506


Why we use methods in java?

530


Differentiate between a constructor and a method? Can we mark constructors final?

669


how to run ecllipse with jettyserver for windows environment using batch file

1486


Can we sort hashset in java?

620