title: How to construct a Date from a String
body: <p>I have to compare two dates in if/else, the current date and the predefined date (let's say 1 Jan 2011). This was supposed to be simple, but I can't find the way to set the predefined date something like:</p>
  
  <pre><code>Java.util.Date date = new Date("2011-01-01");
  </code></pre>
  
  <p>How to compare two dates? I really don't know why it's so complicated to do. </p>