Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.CharArrayWriter;

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

        CharArrayWriter chw = new CharArrayWriter();

        CharSequence csq = "java2s.com";

        // append character sequence to the writer
        chw.append(csq);

        // print character sequence
        System.out.println(csq);

        // invoke reset()
        chw.reset();

        csq = "1234567890";

        chw.append(csq);
        System.out.println(chw.toString());

    }
}