Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) throws Exception {
        InputStream in = System.in;
        BufferedWriter bw = new BufferedWriter(new FileWriter("output.txt"));

        int letter;

        while ((letter = in.read()) != -1) {
            bw.write((char) letter);
            bw.flush();
        }
    }
}