title: Is this a good solution for comparing String to Date?
body: <p>Ok, I am building app for mobile phone so the app needs to very little memory. In Database I have the string in yyyy-MM-dd format, example "1980-11-17". I also have a list of 121 consecutive dates like this:</p>
  
  <pre><code>"1977-12-12", "1978-11-13", "1979-12-14","1980-12-16",...
  </code></pre>
  
  <p>I compare string rather than convert the String to Date.</p>
  
  <pre><code>if(yyyyMmDd.compareTo("1977-12-12")&gt;=0 &amp;&amp; yyyyMmDd.compareTo("1978-11-13")&lt;=0){
          return 1;
  }
  else if(yyyyMmDd.compareTo("1979-12-14")&lt;=0){
          return 2;
  }
  else if(yyyyMmDd.compareTo("1980-12-16")&lt;=0){
          return 3;
  }
  ..... need to do another 119 times
  </code></pre>
  
  <p>The goal is to let the computer to use as little energy as possible. Others may require to convert String to <code>java Date</code> but i am not sure if it is better than <code>compareTo</code> String</p>