title: What is the correct way to declare a boolean variable in Java?
body: <p>I have just started learning Java. In the online course I am following, I am asked to try the following code:</p>
  
  <pre><code>String email1 = "meme@me.coh";
  String email2 = "meme@me.com";
  Boolean isMatch = false;
  
  isMatch = email1.equals (email2);
  
  if (isMatch == true){
      System.out.println("Emails match");
  }
  else{
      System.out.println("Emails don't match");
  }
  </code></pre>
  
  <p>I don't understand why I'm asked to declare <code>isMatch</code> as false when on the next line i am comparing the email addresses and assigning the value to <code>isMatch</code>.<br>
  I've tried the following code which seems to work just the same:</p>
  
  <pre><code>String email1 = "meme@me.coh";
  String email2 = "meme@me.com";
  Boolean isMatch;
  
  isMatch = email1.equals (email2);
  
  if (isMatch == true){
      System.out.println("Emails match");
  }
  else{
      System.out.println("Emails don't match");
  }
  </code></pre>
  
  <p>On the course it doesn't explain why I'm declaring <code>isMatch</code> as false first. Is there a reason why I must declare <code>isMatch</code> as false before comparing the email addresses? </p>