CharArrayReader markSupported() in Java

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

Syntax:

boolean java.io.CharArrayReader.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.CharArrayReader;
import java.io.IOException;

public class CharArrayReadermarkSupported {

    public static void main(String[] args) throws IOException {
        char buf[] = { 'a', 'b', 'c', 'd' };
        CharArrayReader charArrayReader =
new CharArrayReader(buf);

        System.out.println(charArrayReader.markSupported());
        charArrayReader.close();

    }
}

Output:

true


No comments:

Post a Comment