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

        // create a new sequence
        String s = "from java2s.com";

        // write a string
        sw.write(s);

        // flush the writer
        sw.flush();

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

    }
}