MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.io.FileWriter;
import java.io.IOException;

public class MainClass {
    public static void main(String[] a) {
        FileWriter writer;
        try {
            writer = new FileWriter("myFile.txt");
            char c = 'A';
            writer.write(c);
            writer.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
}