I want to create a simple console account application that allow's you to create accounts and the accounts will be save in a txt files. Code:My problem: Every time a new account is created all previous accounts will be deleted because I use: u.println(""); and p.println(""); How can I fix this problem? Thanks!package main; import static java.lang.System.out; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class mainClass { public static void main(String[] args) throws FileNotFoundException { Scanner sn = new Scanner(new File("Usernames.txt")); Scanner s = new Scanner(System.in); newAccount a = new newAccount(); int ID = 0; while(sn.hasNext()){ ID = ID + 1; sn.nextLine(); } do{ out.print("Enter username: "); a.user = s.nextLine(); out.print("Enter password: "); a.password = s.nextLine(); a.ID = ID; a.print(); out.println(); out.print("Create another account?"); }while(s.findWithinHorizon(".", 0).charAt(0) == 'y'); } } //Method class package main; import java.io.FileNotFoundException; import java.io.PrintStream; public class newAccount { String user; String password; int ID; void print() throws FileNotFoundException{ PrintStream u = new PrintStream("Usernames.txt"); PrintStream p = new PrintStream("Passwords.txt"); for(int i = 0; i < ID; i++){ p.println(); u.println(); } u.println(user); p.println(password); } }