Question
Can anyone please explain to me why something that looks so simple, I have seen others provide the answer and code on chegg. But I
Can anyone please explain to me why something that looks so simple, I have seen others provide the answer and code on chegg. But I am confused what this program is to do? Do I make a file? I made a file that I named lab10 in notepad. I have tried everything and I am so confused what my teacher wants. I feel that my program is not outputting what my teacher wants. It doesn't seem to be reading anything or outputting to a file. Please comment back to my questions after you answer with code and break down what my teacher means. Please help me get the right output I am feeling so defeated right now.
8 SE- writeFile.java Fileretrieval.java package-info.java Filestring.java X 2 package writingfiles; ze import java.io.BufferedReader; 4 import java.io.BufferedWriter; 5 import java.io.FileReader; 6 import java.io.FileWriter; 7 import java.io.IOException; 8 public class Filestring { 9 public static void main(String[] args) throws IOException 10 { String datal="ABC", data="DEF", data3="GHI", data4="JKL", data5="MNO"; 12 FileWriter writer=new FileWriter("lab10.txt"); 13 BufferedWriter buffWriter=new BufferedWriter(writer); buffWriter.write(datal+" "); 15 buffWriter.write(data2+" "); 16 buffwriter.write(data3+" "); 17 buffwriter.write(data4+" "); $18 buffwriter.write(data5+" "); 19 buffWriter.close(); FileReader reader=new FileReader("lable. txt"); BufferedReader buffReader=new BufferedReader(reader); 22 String datab=buffReader.readLine(); a 14 vaSE- 20 21 ava e Console XStep 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