title: How would you add a time offset using the same name as the class name for the parameter
body: <p>I need to fill out the method for the time offset but using the class name as a parameter name and I don't know how to do it
  I have tried adding the variables together but I get errors saying &quot;You can't convert Time to an int&quot;</p>
  <p>So I have no clue on what to do,
  please respond soon
  thank you!</p>
  <p>Error type:</p>
  <pre class="lang-none prettyprint-override"><code>Time.java:48: error: bad operand types for binary operator '+'
         this.minutes += offset;
                      ^
    first type:  int
    second type: Time
  1 error
  </code></pre>
  <pre><code>public class Time
  {
     // The values of the three parts of the time
     private int hours;
     private int minutes;
     private int seconds;
  
     public Time()
     {
        this.hours = 0;
        this.minutes = 0;
        this.seconds = 0;
     }
  
     public Time(int h, int m, int s)
     {
        this.hours = h;
        this.minutes = m;
        this.seconds = s;
     }
     
     public void add(Time offset)
     {
          // Part b: complete the add method
     }
  
     public String toString()
     {
        return pad(hours) + &quot;:&quot; + pad(minutes) + &quot;:&quot; + pad(seconds);
     }
  
     private String pad(int value)
     {
        String sign = &quot;&quot;;
        if (value &lt; 0)
        {
           sign = &quot;-&quot;;
           value = -1 * value;
         }
         if (value &lt; 10) {
            return sign + &quot;0&quot; + value;
         } else {
            return sign + value;
         }
      }
  
      public static void main(String[] args)
      {
         Time time1 = new Time(1,1,1);
         Time time2 = new Time(2,2,2);
         time1.add(time2);
         System.out.println(&quot;The result of (1,1,1).add(2,2,2) is &quot; +
                             time1 + &quot; and should be (03:03:03)&quot;);
  
         time1 = new Time(0,0,59);
         time2 = new Time(0,0,1);
         time1.add(time2);
         System.out.println(&quot;The result of (0,0,59).add(0,0,1) is &quot; +
                             time1 + &quot; and should be (00:01:00)&quot;);
  
         time1 = new Time(0,59,0);
         time2 = new Time(0,0,1);
         time1.add(time2);
         System.out.println(&quot;The result of (0,59,0).add(0,0,1) is &quot; +
                             time1 + &quot; and should be (00:59:01)&quot;);
  
         time1 = new Time(0,59,59);
         time2 = new Time(0,0,1);
         time1.add(time2);
         System.out.println(&quot;The result of (0,59,59).add(0,0,1) is &quot; +
                             time1 + &quot; and should be (01:00:00)&quot;);
  
         time1 = new Time(23,0,0);
         time2 = new Time(1,0,0);
         time1.add(time2);
         System.out.println(&quot;The result of (23,0,0).add(1,0,0) is &quot; +
                             time1 + &quot; and should be (00:00:00)&quot;);
  
         time1 = new Time(23,59,59);
         time2 = new Time(23,59,59);
         time1.add(time2);
         System.out.println(&quot;The result of (23,59,59).add(23,59,59) is &quot; +
                             time1 + &quot; and should be (23:59:58)&quot;);
     }
  }
  </code></pre>