BufferedReader markSupported() in Java

markSupported(): This method is available in the java.io.BufferedReader class of Java.

Syntax:

boolean java.io.BufferedReader.markSupported()

This method tells whether this stream supports the mark() operation, which it does.

Parameters: NA

Returns: true if and only if this stream supports the mark operation.

Exceptions: NA

Approach

Java

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class BufferedReadermarkSupported {
    public static void main(String[] args) throws IOException {

        FileReader fileReader = new FileReader("D:\\hello.txt");
        BufferedReader bufferedReader =
new BufferedReader(fileReader);

        System.out.println(bufferedReader.markSupported());

        bufferedReader.close();

    }
}

Output:

true


No comments:

Post a Comment