Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.BufferedReader;
import java.io.FileReader;

public class Main {
    public static void main(String[] args) throws Exception {
        String srcFile = "test.txt";
        BufferedReader br = new BufferedReader(new FileReader(srcFile));
        String text = null;

        while ((text = br.readLine()) != null) {
            System.out.println(text);
        }
        br.close();
    }
}