Java IO Tutorial - Java CharArrayReader(char[] buf) Constructor








Syntax

CharArrayReader(char[] buf) constructor from CharArrayReader has the following syntax.

public CharArrayReader(char[] buf)

Example

In the following code shows how to use CharArrayReader.CharArrayReader(char[] buf) constructor.

//from   www . j a  v a  2 s. c o m
import java.io.CharArrayReader;

public class Main {
  public static void main(String[] args) throws Exception {

    char[] ch = { 'A', 'B', 'C', 'D', 'E' };

    CharArrayReader car = new CharArrayReader(ch);

  }
}