Question: please write of the codes. if there is an error, then please explain what the error is? String insurfilin Name in texif Aleos-tat. five inperfite
String insurfilin Name in "texif Aleos-tat". five inperfite w new rilefinputfaliatol. Steing line in tradfrie nestl. readrilecione(0i) impurt java,uril *; import java. io.*; public staric void main[string argsfi] throws filefotfoundficestion f. String inputfileName = "textrile01.tat": File inpoutfile = nerw Filefinputfiletuarne). Scanner readrile n new Scannerfinputfile). whildefecadfferfas Next(i) f Strine line = readfale.neatlined. System.out.printin(line):) readfile,close(1): import java. util. * import java.io. * public static void main(String argsil) thirows FileNotfound Exception 1 String inputfileName = "textfile01.bet": File inputFile = new Filefinput File Nameli; Scanner readfite a new Scanner(inputfile). Whike(readfile. has NextDouble()1) String line = readFile.nextified: System.out.printin(line): } readfile.close(): ) import java. util.*; import java.io. *; public static void main(String args[]) throws FleNotFoundException \{ String inputFileName = "textFile01.bxt"; File inputFile = new File(inputFileName); Scanner readfile = new Scanner(inputFile); while(readFile.hasNextint()) : String line = readFile.nextline(1: System.out.printin(line):) readfile.close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
