title: Cannot invoke String.equals(Object)
body: <pre class="lang-java prettyprint-override"><code>private void login() throws UserException, NoSuchAlgorithmException, InvalidKeySpecException {
      System.out.println(&quot;=== Log in ===&quot;);
      while (true) {
          System.out.println(&quot;Enter your login \nor Enter EXIT for return to main menu -&gt;&quot;);
          String inputLogin = this.sc.nextLine();
          if (&quot;EXIT&quot;.equalsIgnoreCase(inputLogin)) {
              break;
          }
          try {
              User user = userImpl.read(inputLogin);
              if (user.getLogin() == null) {
                  System.err.println(&quot;Username incorrect.&quot;);
              } else {
                  System.out.println(&quot;Enter your password \n or Enter EXIT for return to main menu -&gt;&quot;);
                  String inputPassword = this.sc.nextLine();
                  user = userImpl.readPassword(inputPassword);
                  if (!user.getPassword().equals(generateStrongPasswordHash(inputPassword)) || &quot;EXIT&quot;.equalsIgnoreCase(inputPassword)) {
                      System.err.println(&quot;Password incorrect&quot;);
                      continue;
                  }
                  System.out.println(&quot;Log in successfully✔✔✔&quot;);
              }
          } catch (UserException | NoSuchAlgorithmException | InvalidKeySpecException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  <p>I'm trying to realise a console program Cinema with using JDBC (MySQL). After using the login method I get this <a href="https://i.stack.imgur.com/TxIiL.png" rel="nofollow noreferrer">Exception</a>.
  How do I realise authorization on the console app?
  <a href="https://i.stack.imgur.com/mUe4L.png" rel="nofollow noreferrer">User</a>
  <a href="https://i.stack.imgur.com/vQJ63.png" rel="nofollow noreferrer">User</a></p>