Write a simple line editor. Keep the entire text in an ArrayList object, one line in a
Question:
Write a simple line editor. Keep the entire text in an ArrayList object, one line in a separate index position. Start the program with entering EDIT file, after which a prompt appears along with the line number. If the letter I is entered with a number n following it, then insert the text to be followed on line n. If I is not followed by a number, then insert the text on the current line. If D is entered with two numbers n and m, one n, or no number following it, then delete lines n through m, line et, or the current line. Do the same with the command L, which stands for listing lines. If A is entered, then append the text to the existing lines. Entry E signifies exit and saving the text in a file.
Here is an example:
Class name: File Edirt.java
Input file: textin. Txt
Content of text txt
The first line:
And another line
Output File: textin.txt
The first line
The second line
One more line
And another line
Computer Networking A Top-Down Approach
ISBN: 978-0136079675
5th edition
Authors: James F. Kurose, Keith W. Ross