PrintWriter setError() method in Java with Examples
The setError() method of PrintWriter Class in Java is used to set the error state of this PrintWriter instance. This method is used as an indicator to indicate that an error has occurred in the stream. It is protected and hence needs to be implemented by deriving the PrintWriter class to use it.
protected void setError()
Parameters: This method do not accepts any parameter.
Return Value: This method do not return anything.
Below methods illustrates the working of setError() method: