StringReader markSupported() method in Java with Examples
The markSupported() method of StringReader Class in Java is used to check whether this StringReader is supports mark() operation or not. It returns a boolean which states if the reader is mark supported.
Syntax:
public boolean markSupported()
Parameters: This method does not accepts any parameters
Return Value: This method returns a boolean value which tells if this StringReader supports mark() operation or not. It return true if it is markSupported. Else it returns false.
Below methods illustrates the working of markSupported() method:
Program 1:
// Java program to demonstrate // StringReader markSupported() method import java.io.*; import java.util.*; class GFG { public static void main(String[] args) { try { String str = "GeeksForGeeks"; // Create a StringReader instance StringReader reader = new StringReader(str); // Check if the StringReader is // markSupported using markSupported() System.out.println("Is StringReader markSupported: " + reader.markSupported()); reader.close(); } catch (Exception e) { System.out.println(e); } } } |
Is StringReader markSupported: true
Program 2:
// Java program to demonstrate // StringReader markSupported() method import java.io.*; import java.util.*; class GFG { public static void main(String[] args) { try { String str = "GeeksForGeeks"; // Create a StringReader instance StringReader reader = new StringReader(str); // Check if the StringReader is // markSupported using markSupported() System.out.println("Is StringReader markSupported: " + reader.markSupported()); reader.close(); } catch (Exception e) { System.out.println(e); } } } |
Is StringReader markSupported: true
Reference: https://docs.oracle.com/javase/9/docs/api/java/io/StringReader.html#markSupported–
Recommended Posts:
- Reader markSupported() method in Java with Examples
- ByteArrayInputStream markSupported() method in Java with Examples
- CharArrayReader markSupported() method in Java with Examples
- PushbackReader markSupported() method in Java with Examples
- StringReader read() method in Java with Examples
- StringReader ready() method in Java with Examples
- StringReader reset() method in Java with Examples
- StringReader close() method in Java with Examples
- StringReader mark(int) method in Java with Examples
- StringReader read(char[], int, int) method in Java with Examples
- StringReader read(char[]) method in Java with Examples
- StringReader skip(long) method in Java with Examples
- StringReader read(CharBuffer) method in Java with Examples
- Java.io.StringReader class in Java
- Java lang.Long.reverse() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


