title: trouble with setTime method
body: <p>Hey guys so I need help with my setTime method. Basically this is the question in my assignment: </p>
  
  <p>Consider a class Time that represents a time of day. It has attributes for the
  hour and minute. The hour value ranges from 0 to 23, where the range 0 to
  11 represents a time before noon. The minute value ranges from 0 to 59.
  a. Write a default constructor that initializes the time to 0 hours, 0 minutes.
  b. Write a private method isValid(hour, minute) that returns true if the
  given hour and minute values are in the appropriate range.
  c. Write a method setTime(hour, minute) that sets the time if the given
  values are valid.</p>
  
  <p>I need help with c, in my code you can see that i have the set time method but when i run my programs and enter the time it returns this instead of the numbers in entered:</p>
  
  <pre><code>Please enter the hour
  3
  Please enter the minute
  23
  The time is time.Time@4d546e25 time.Time@620b66cc
  BUILD SUCCESSFUL (total time: 3 seconds)
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package time;
  
  /**
   *
   * @author 
   */
  public class Time {
  
  /**
   * @param args the command line arguments
   */
  
  //default constructor
  
  public static int hour;
  public static int minute;
  
  
  public Time(){
      hour = 0;
      minute = 0;
  
  }
  
  
   private static boolean isValid(int hour, int minute)
   //returns true if given hour &amp; minute values are in range
   {
      if((hour &gt;= 0 &amp;&amp; hour &lt;= 23) &amp;&amp; (minute &gt;= 0 &amp;&amp; minute &lt;=11))
      {
          return true;
      }
      else
      {
          return false;
      }
   }
  
  
  public void setTime(int hour, int minute)
   //set time if given values are valid - 
  {
      System.out.println("Please enter the hour");
      Scanner keyboard = new Scanner (System.in);
      int num1 = keyboard.nextInt();
  
      Time.hour = num1;
      System.out.println("Please enter the minute");
      int num2 = keyboard.nextInt();
      Time.minute = num2;
  
  }
  
  
  public static void main(String[] args) {
      // Karamullah Agha
  
      Time hour = new Time();
      Time minute = new Time();
  
      hour.setTime(0,0);
  
  
      System.out.println("The time is " + hour + " " + minute);     
  
    }
  }
  </code></pre>