Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.*;

public class Main {

    public static void main(String[] args) {

        StringWriter sw = new StringWriter();

        CharSequence sq = "tutorial from java2s.com";

        // append sequence
        sw.append(sq, 0, 5);

        System.out.println(sw.toString());

        // append second sequence
        sw.append(sq, 6, 5);

        System.out.println(sw.toString());

    }
}