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

Why we do exception handling in java and how many types of exceptions are there?

0 Answers  


worst case complexities of Quick sort and Merge sort.

0 Answers   Amazon,


What is the difference between a vector & an array list?

0 Answers   Agilent,


Can we extend immutable class?

0 Answers  


What is consumer interface?

0 Answers  






How do you declare an array in java?

0 Answers  


What is java english?

0 Answers  


1.) if we use "private" in place of "public" in public static void main()... 2.) if we use "int" in place of "void".... 3.) can we ommit "static" keyword from that statement.... 4.) also can we give the command line arguments type as int type or float,etc.(.i.e (string args[]))

1 Answers  


Java Compiler is stored in JDK, JRE or JVM?

0 Answers  


How to make a write-only class in java?

0 Answers  


difference between String a; and String a=new String();? y do v need to assign memory to the variable?

2 Answers  


What is unsigned char?

0 Answers  


Categories