title: How can I assign an int to a String variable?
body: <p>I am currently making an assignment for Java but I am stuck. I have to make a birthdate from the three parameters: day, month and year, which are numbers = int. With this I have to put in some checks for valid dates. That part I think is done, but I get stuck at the following:</p>
  
  <p>I want an if statement to check the day, and if the day is correct, this block of code should be run trough</p>
  
  <pre><code>if (dag &gt;=1 &amp;&amp; dag &lt;=31) 
  {
      datum = dag; 
  }
  </code></pre>
  
  <p><code>datum</code> Is a String, because I want to get the date like this: DD-MM-YYY
  And <code>dag</code> is an Int. So whenever I try to compile this, BlueJ gives an error at this part saying "incompatible types". I assume this is because I try to place a Int in a String. Is this possible in any way, because I can't find out how.</p>