CharArrayWriter close() method in Java with examples
The close() method of the CharArrayWriter class in Java is used to close the current stream.
public void close()
Parameters: This method does not accept any parameter.
Return Value: This method closes the current stream. However, it does not release the buffer.
Below program illustrate the above method:
Size of char_array1 : 5
Size of char_array1 : 6
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.