title: Java if statement strings and more
body: <p>I have decided to try and learn a little in java tonight and i have just been trying some stuff with things i have learned.</p>
  
  <p>My question is in an if statement how to i make two stings to be true.  Here is what i have so far.</p>
  
  <pre><code>if ("male".equals(gender)) &amp;&amp; ("brendan".equals(name))
  </code></pre>
  
  <p>The problem i am pretty sure is the &amp;&amp; but i am not sure.</p>
  
  <p>EDIT EDIT EDIT.</p>
  
  <p>This fixed part of the problem.<br>
  <code>if("male".equals(gender) &amp;&amp; "Brendan".equals(name))</code><br>
  and so did this  </p>
  
  <pre><code>if (("male".equals(gender)) &amp;&amp; ("brendan".equals(name)))
  </code></pre>
  
  <p>Now i will post the whole thing i am having another issue now and you would probably need to see the whole thing.  </p>
  
  <pre><code>import java.util.Scanner;
  
  public class my_input_and_if_statements 
  {
      public static void main (String args[])
  {
      Scanner jonks = new Scanner(System.in);
      String name, gender, answer;
      System.out.println("What is your name?");
      name = jonks.next();
      System.out.print("Hello ");
      System.out.print( name);
      System.out.println(" are you male or female?");
      gender = jonks.next();
  
          if (("male".equals(gender)) &amp;&amp; ("brendan".equals(name)))            
              {
              System.out.println("blah blah");
              }
  
          else
              {
              System.out.println(" Welcome to one of my first java applications. I hope you like it");
              }
  
          if (("female".equals(gender)) &amp;&amp; ("nicole".equals(name))) 
              {
              System.out.println("blah blah 2");
              }
          else
              {
              System.out.println(" Welcome to one of my first java applications. I hope you like it");
              }
  
              }
  }
  </code></pre>
  
  <p>sorry if this seems kind of pointless just trying to tie some stuff in together before i start trying to learn some more.  </p>
  
  <p>now when i go through it gives me two lines when it finishes or it gives me both. </p>