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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / therathna

By using length and capacity methods.


For this use JDK api we get complete details

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

Describe the process as to how substring() methodology mechanisms in java.

0 Answers  


How do I get a substring?

0 Answers  


Why Java is not purely object oriented?

50 Answers   Elitecore, Persistent, Reliance, Wipro,


what are literals in java?

2 Answers  


did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???

7 Answers   IBM,






How TreeMap sorts the objects inside it?? suppose if have include one employee object and one car object. On what basis it will sort?

5 Answers  


Instead of writing Home, Remote Interfaces if i directly extends EJBObject to bean class what happens?

1 Answers   Flextronics,


What is the use of parse function in java?

0 Answers  


what is the difference between HashMap and Hashtable

17 Answers   Value Labs, Virtusa,


why not override thread to make a runnable? : Java thread

0 Answers  


Why lambda expression is used in java?

0 Answers  


What are internal and external variables?

0 Answers  


Categories