Reader reset() method in Java with Examples
The reset() method of Reader Class in Java is used to reset the stream. After reset, if the stream has been marked, then this method attempts to reposition it at the mark, else it will try to position it to the starting.
public void reset()
Parameters: This method do not accepts any parameter.
Return Value: This method do not returns any value.
Exception: This method throws IOException:
- if some error occurs while input output
- if the stream has not been marked
- if the mark has been invalidated
- if the reset() method is not supported.
Below methods illustrates the working of reset() method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.