title: How do I return my string inside an if statement?
body: <pre><code>public static String  mixColors1(String x, String y)
  {
      String red="red";
      String yellow="yellow";
      String blue="blue";
      String color = null;//this line... is an issue
      if(red == x &amp;&amp; yellow == y || red == y &amp;&amp; yellow == x)//if red&amp;yellow selected
          color = "orange";//return orange
  
      else if(red == x &amp;&amp; blue == y || red == y &amp;&amp; blue == x)//if red&amp;blue selected
          color = "purple";//return purple
  
      else if(yellow == x &amp;&amp; blue == y || yellow == y &amp;&amp; blue == x)//if blue&amp;yellow selected
          color = "green";//return green
  
      return color;
  }
  </code></pre>