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) {
        int c = 70;

        Writer writer = new PrintWriter(System.out);

        try {
            // write an int that will be printed as ASCII
            writer.write(c);

            // flush the writer
            writer.flush();

            // write another int that will be printed as ASCII
            writer.write(71);

            // flush the stream again
            writer.flush();

        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}