// First example program that reads a word from an input file. import java.io.*; // for File import java.util.*; // for Scanner public class ReadFile { public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File("data.txt")); String text = input.next(); System.out.println(text); } }