title: Calling a print method from another class with primitive data types in it
body: <p>I have been programming in Java using BlueJ for 2 months now and I need some help with an assignment. I am making a basic Vehicle Purchase data entry program. I need to call the <code>printPurchaseDate()</code> method from the <code>PurchaseDate</code> class. The problem I am faced with is that the print statement has three int values: year, month, and day. When I try to call this method in the Vehicle class in the <code>printDetails()</code> method, it tells me that I need a return, if I take away the void I have to label the method as a string. However it doesn't work then because it holds three int variables inside it that conflict with the string method. How can I go about doing this? I basically want to print all of my information including the <code>purchaseDate</code>.  My apologies in advance if I did not present my question properly, this is my first post. Thank you for your help.</p>
  
  <p>I have two classes: Purchase Date and Vehicle.</p>
  
  <p>My vehicle class has this method, designed to print out my information:</p>
  
  <pre><code>public void printDetails() {
      System.out.println("Customer:" + " " +
      customer.getFullName());
      System.out.println("Vehicle Description:" + " " + 
      getVehiclePurchased());
      PurchaseDate.printPurchaseDate();
  }
  </code></pre>
  
  <p>Im having issues with printing  the date from my PurchaseDate class in my Vehicle class's "printDetails()" method.    </p>
  
  <pre><code>/**
    * The Purchase data class
    */
  
  public class PurchaseDate {
  
      private int year;
      private int month;
      private int day;
  
      private static final int CURRENT_YEAR = 2014;
      private static final int LAST_MONTH = 12;
      private static final int LAST_DAY = 31;
  
      /**
       * default constructor
       */
      public PurchaseDate() {
      }
  
      /**
       * @param year to initialize theYear field
       * @param month to initialize theMonth field
       * @param day to initialize theDay field
       */
  
      public PurchaseDate(int theYear, int theMonth, int theDay) {
      setYear(theYear);
      setMonth(theMonth);
      setDay(theDay);
  
      if (year &lt; 1900 || year &gt; 2014) {
              System.out.println("The year value can be no greater than the current year");
          } else {
              this.year = year; }
      if (month &lt; 1 || month &gt; 12) {
              System.out.println("The month value must be between 1 and 12");
          } else {
              this.month = month; }        
      if (day &lt; 1 || day &gt; 31) {
              System.out.println("The day value must be between 1 and 31");
         } else {
              this.day = day; }
      }        
      //Mutators and Accessors    
      /**
       * @return year
       */
      public int getYear() {  
          return year;
      }
  
      /**
       * @return month
       */
      public int getMonth() {
          return month;
      }
  
      /**
       * @return day
       */
      public int getDay() {
          return day;
      }
  
      /**
       * @param the year
       */
      public final void setYear(int newYear) {
          year = newYear;
      }
  
      /**
       * @param the month
       */
      public final void setMonth(int newMonth) {
          month = newMonth;
      }
  
      /**
       * @param the day
       */
      public final void setDay(int newDay) {
          day = newDay;
      }
  
      /**
       * prints the purchase date
       */
      public void printPurchaseDate() {
          System.out.println("The purchase date is:" + " " + year + "-" + month + "-" + day);
  
      }
  }
  </code></pre>
  
  <p>I basically want my <code>System.out.println</code> to print out the date
  that I have in my <code>PurchaseDate</code> class.</p>