Java CharArrayReader.close()
Syntax
CharArrayReader.close() has the following syntax.
public void close()
Example
In the following code shows how to use CharArrayReader.close() method.
/* w w w .jav a 2 s .c om*/
import java.io.CharArrayReader;
public class Main {
public static void main(String[] args) throws Exception {
char[] ch = { 'H', 'E', 'L', 'L', 'O' };
CharArrayReader car = new CharArrayReader(ch);
car.close();
// read the character array stream
System.out.println(car.read());
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »