title: Java: print a value from another class
body: <p>I have another class in my program called "time".  I need to know how to use the  toString() in my main program that will display the time startTime variable
  and the time endTime variable</p>
  
  <pre><code>package concertapp;
  
  public class Concert  {
  
      public String name;
      public Time startTime;
      public Time endTime;
  
      public Concert (String n,Time start,Time end) {
          name=n;
          startTime=start;
          endTime=end;
      }
  
      @Override
      public String toString() {
          return String.format("%d:%02d:%02d ",startTime,endTime);
          //how do i make this work using my time class, 
          //and being able to print the toString() in main class??
      }
  }
  </code></pre>