import [Link].
File; // Import the File class
import [Link]; // Import this class to handle errors
import [Link]; // Import the Scanner class to read text files
public class ReadFile1 {
public static void main(String[] args) {
try {
File myObj = new File("C:\\Users\\itlab3\\Desktop\\Module6_Act1.txt");
Scanner myReader = new Scanner(myObj);
while ([Link]()) {
String data = [Link]();
[Link](data);
}
[Link]();
} catch (FileNotFoundException e) {
[Link]("An error occurred.");
[Link]();
}
}
}