Q:

How to use a return object's getter method?

This is part of my employee program.  I've only been practicing Java for a few months and I'm having some trouble.
I need to use the new MonthDataPair provided in the findHightest method which provides an object with the paramaters highestMonth and maxSalary. I need to use that object's getter method to return the month and salary. The code below simply finds the month in which the data I wish to access is stored. Now I need to display the data and I'm not sure how to do that correctly.
All of the data comes from a document that was read and stored in an array.
    private MonthDataPair findHighest() {
        int highestMonth = 0;
        double maxSal = -1;
        for (int index = 0; index < MonthCount; index++) {
            double total = theMonth[index].totalSalary();
            if (total > maxSalary) {
                maxSalary = total;
                highestMonth = [theMonthindex].Month();
            } 
        } 
        return new MonthDataPair(highestMonth, maxSalary);
    } 

OK guys here's the MonthDataPair this is practice for an exam and I'm not allowed to modify the MonthDataPair class that is below.  It was provided.
public class MonthDataPair {

private final int    month;
private final double data;

 public MonthDataPair(int month, double data) {
  this.data = data;
  this.month = month;
 } 

 public int month() {
    return month;
} 

   public double data() {
   return data;
  }  

} 

A:

Add 
 int getMonth(){
    return month;
   }

   double getSalar(){
    return salary;
   } 

methods in MonthDataPair class
You class should be like this
public class MonthDataPair {
int month;
double salary;

public MonthDataPair(int month, double salary) {
    this.month = month;
    this.salary = salary;
}

public int getMonth() {
    return month;
}

public void setMonth(int month) {
    this.month = month;
}

public double getSalary() {
    return salary;
}

  public void setSalary(double salary) {
    this.salary = salary;
  }

 }

