Java - Storing Names in ArrayList and Using it to Login
<p>I have a task to do which involves asking the user to input their last name and giving the user an account number to login to the program. I have listed the steps below which might make more sense.</p>

<p>1) User creates an account</p>

<p>2) User enters their last name (Stores into the arraylist)</p>

<p>3) User is given an account number (Stores into the arraylist)</p>

<p>4) User can then login using their last name and account number (checks arraylist for lastname and accountnumber, if it matches then login message, if it doesnt then error message)</p>

<p>A user enters their last name and they are given an account number which they then use to login to deposit, withdraw and check balance.</p>

<p>How do i create a programe to do this without the use of database?</p>

<p><strong>Account Class</strong></p>

<pre><code>private static int number = 500;

    Account(){
        accountNumber = number++;
    }
</code></pre>

<p><strong>Create Account</strong></p>

<pre><code>public void createAccount(){

String firstName;

System.out.print("Please Enter Last Name: ");
lastName = scanner.nextLine();
System.out.println("This is your Account Number to log into: " + _______ );
}

public void logIn(){

    System.out.println("Please enter your last name: ");

    System.out.println("Please enter your account number: ");

}
</code></pre>