Question: Q-1: Write a program (AddLineNumbers) that reads a file (file.txt) and writes a copy of the file to another file (output.txt) with line number inserted

Q-1: Write a program (AddLineNumbers) that reads a file (file.txt) and writes a copy of the file to another file (output.txt) with line number inserted into the beginning of each line.

file: /** data input * TXT */ public class Hello { public static void main( String [] args ) { System.out.println( "Hello" ); } }

Q-2: Write a program (ReadTextFile) that reads a file (file2.txt) that contains only one line; output all the character per line.

file2:

hello

note : java language and topic is : exception and I/O operations

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!