programiz.com
Java Program to Clear the StringBuffer - Programiz
In this example, we will learn to clear the string buffer using the delete() and setLength() method and creating a new StringBuffer object in Java.
In this example, we will learn to clear the string buffer using the delete() and setLength() method and creating a new StringBuffer object in Java.
Example 2: Java Program to Read File Using BufferedReader. import java.io.FileReader; import java.io.BufferedReaderReading File Using Scanner: First Line Second Line Third Line Fourth Line Fifth Line. In the above example, we have created an object of File class named file.