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

What is the difference between Trusted and Untrusted Applet ?

2 Answers   IBM,


How does predicate work in java?

0 Answers  


What best practices should you follow while writing multithreaded code in java?

0 Answers  


Can an interface extend another interface?

0 Answers  


Is null in java?

0 Answers  


write a program to create an vector with string(add,remove) operation.and value should be enter through keyboard.

0 Answers   Axcend,


What modifiers are used with a top level class?

3 Answers  


What is difference between final and finally in java?

0 Answers   Cyient,


What are the Memory Allocations available in JavaJava?

1 Answers  


What are the two types of exceptions in java? Which are the differences between them?

0 Answers  


why using interface interface ?

0 Answers  


I want to persist data of objects for later use. What’s the best approach to do so?

0 Answers  


Categories