Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        File file = new File("sample.txt");

        String content = FileUtils.readFileToString(file);

        System.out.println("File content: " + content);
    }
}