title: Comparing two strings with boolean?
body: <p>I was trying this code writing exercise and I am so lost!</p>
  
  <p>The exercise is:</p>
  
  <p>Complete the method which takes two Strings and one boolean as input. If the boolean is true, this method compares the first two Strings, ignoring case considerations (uppercase/lowercase). Two Strings are considered equal ignoring case if they are of the same length, and corresponding characters in the two Strings are equal ignoring case.</p>
  
  <p>If the boolean is false, this method should compare two Strings and return true if the first String represents the same sequence of characters as the second String, otherwise false.</p>
  
  <p>Note: <code>compareTwoStrings("HELLO", "", false)</code> should return false.</p>
  
  <p>And here is my attempt:</p>
  
  <pre><code>public boolean compareTwoStrings (String a, String b, boolean isIgnoreCase) 
  { 
      if (a.equalsIgnoreCase(b)) {
          return (isIgnoreCase==true);
      }
      else if (a.equals(b)) {
         return (isIgnoreCase==false);
      }
  }
  </code></pre>
  
  <p>It doesn't even compile, but even if it did, I'm sure it wouldn't work.</p>