title: Simple login Java program
body: <p>I'm very new to Java, and I want to make a very simple login Java-program.
  Don't think about security issues and such in this example, I just need help to get it right.
  My "Account informations" has to be stored in an Array.</p>
  
  <p>This is my code:
  -- MAIN --</p>
  
  <pre><code>import java.util.Scanner;
  public class BATM {
  
  public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
  
      String username;
      String password;
  
      System.out.println("Log in:");
      System.out.println("Indtast username: ");
      username = input.nextLine();
  
      System.out.println("Indtast password: ");
      password = input.nextLine();
  
      users check = new users(username, password);
  
      if(check.auth()) 
          System.out.println("You are logged in");
  
  
  
  }
  
  }
  </code></pre>
  
  <p>-- users ---</p>
  
  <pre><code>public class users {
  private String username;
  private String password;
  private String[][] accounts = {{"jesper", "abc123"},{"christian", "abc123"}};
  
  public users(String user, String pass){
      username = user;
      password = pass;
  }
  
  public boolean auth(){
      if((username == accounts[0][0]) &amp;&amp; (password == accounts[0][1]))
          return true;
      else
          return false;
  }
  
  }
  </code></pre>
  
  <p>I guess this should be a quite simple function, but for some reason the if-statment will never return "true". </p>
  
  <p>What am I doing wrong?</p>
  
  <p>Jesper.</p>