write a java program to concatenate the one file into the end of another file.
help me need it urgently
Answers
Answered by
1
Answer:
Let the given two files be file1.txt and file2.txt. Our Task is to merge both files into third file say file3.txt. The following are steps to merge.
Create PrintWriter object for file3.txt
Open BufferedReader for file1.txt
Run a loop to copy each line of file1.txt to file3.txt
Open BufferedReader for file2.txt
Run a loop to copy each line of file2.txt to file3.txt
Flush PrintWriter stream and close resources.
To successfully run the below program file1.txt and file2.txt must exits in same folder OR provide full
Explanation:
hope it is helpful
Similar questions
Math,
27 days ago
Computer Science,
27 days ago
Math,
27 days ago
Math,
1 month ago
Math,
8 months ago
Social Sciences,
8 months ago