title: How to use type Date in new Java Object?
body: <p>I would like to know how to use type Date in new object?</p>
  
  <p>I'll explain a bit more be showing my code:</p>
  
  <p>I got a Java class called:</p>
  
  <p>Reiziger:</p>
  
  <pre><code>import java.util.Date;
  
  public class Reiziger {
      private String naam;
      private Date gbdatum;
  
      public Reiziger(String nm, Date gbdtm) {
          this.naam = nm;
          this. gbdatum = gbdtm;
      }
  
      public String getNaam() {
          return naam;
      }
  
      public void setNaam(String naam) {
          this.naam = naam;
      }
  
      public Date getGBdatum() {
          return gbdatum;
      }
  
      public void setGBdatum(Date gbdatum) {
          this.gbdatum = gbdatum;
      }
  
      public String toString() {
          return naam + gbdatum;
      }
  }
  </code></pre>
  
  <p>And a Main:</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) {
          Reiziger r1 = new Reiziger("Joost", "01-01-1994");
          Reiziger r2 = new Reiziger("Hans", null);
  
          ReizigerOracleDaoImpl i1 = new ReizigerOracleDaoImpl();
          i1.alleReizigers.add(r1);
          i1.alleReizigers.add(r2);
          System.out.println(i1.alleReizigers);
      }
  }
  </code></pre>
  
  <p>As you see in my main i tried alot of things only null is working. I want to add the the object a date -> for example: 01-01-1994 but doesnt work.</p>
  
  <p>I tried it without the " " also nothing.</p>
  
  <p>any idea what i'm doing wrong?</p>