Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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);

        int value = 0;

        while ((value = car.read()) != -1) {
            System.out.print((char) value);
        }
        car.reset();
        while ((value = car.read()) != -1) {
            System.out.print((char) value);
        }

    }
}