How to Change From StringBuffer and StringBuilder to String and vice versa ??
StringBuffer and StringBuilder
982
21-Jul-2018
Prakash nidhi Verma
21-Jul-2018From StringBuffer and StringBuilder to String :
using toString() method which is overridden in both StringBuffer and StringBuilder classes.means the subsequent changes to the StringBuffer object do not affect the contents of the String object.
From StringBuffer to StringBuilder or vice-versa :
There is no direct way to convert the same. We firstconvert StringBuffer/ StringBuilder object to String using toString() method