class Demo { public static void main(String[] args) { StringBuffer str = new StringBuffer("Technology"); System.out.println(str); String str1 = str.toString(); System.out.println(str1); // StringBuffer to String convertion // o/p - Technology // Technology } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter