// importing the FileReader class
import java.io.FileReader;
class Main {
public static void main(String[] args) {
char[] array = new char[100];
try {
// Creates a reader using the FileReader
FileReader input = new FileReader("input.txt");
// Reads characters
input.read(array);
System.out.println("Data in the file:");
System.out.println(array);
// Closes the reader
input.close();
}
catch(Exception e) {
e.getStackTrace();
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: