Question
For Java Programing, 1. Name at least five different file categories. 2. What kind of data may be stored in a file? 3. What are
For Java Programing,
1. Name at least five different file categories.
2. What kind of data may be stored in a file?
3. What are at least four methods associated with file processing (using JAVA of course)?
4) Execute the following code to read a file.
import java.io.*;
public class ReadFile {
public static BufferedReader buffer;
public static void main(String[] args)
{
try {
// create a FileReader object
FileReader file = new FileReader("Frost.txt");
// create a BufferedReader object to read the file
BufferedReader buffer = new BufferedReader(file);
String line ="";
while((line=buffer.readLine()) !=null)
{
System.out.println(line);
}
//close the BufferedReader Object
buffer.close();
}
catch (IOException e)
{
System.out.println("A read error has occurred");
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started