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

Explain when we should make an instance variable private.

0 Answers  


What is double in java?

0 Answers  


What is emant by API? is it related to java only or it is common for all OOPS supporting language?

3 Answers  


What is bigger kb or mb?

0 Answers  


What is the method to declare member of a class static?

0 Answers   HCL,






Can a static class have a constructor java?

0 Answers  


difference between arraylist and linkedlist otherthan performance

2 Answers   L&T,


Can u overload main()method.Give with example.

6 Answers   IBM, Schimatic Technologies,


What is the difference between the boolean & operator and the && operator in java programming?

0 Answers  


How many types of gc are there in java?

0 Answers  


What is inner class?what is the use of inner class?where we create the object for inner class? and inner class can extend any class or inner class can implement any interface?

1 Answers   Wipro,


How do you create a first line indent?

0 Answers  


Categories