Calculating min and max with if-statements within a for-loop
The code violates Tell, Don't Ask:


  Procedural code gets information then makes decisions. Object-oriented code tells objects to do things.
  ~Alec Sharp


Before we get to that, consider:

fillUps[i].getDist() &gt; dMin


Can be written:

fillUps[i].canTravel( dMin )


Similarly:

fillUps[i].getPrice() &gt; priceMax


Can be written:

fillUps[i].priceExceeds( priceMax );


The important question remains unanswered: why does the code check against distance and price? If all you want to do is determine how much it will cost on a given tank of gas, then write:

float maxDistance = fillUps[i].calculateDistance();


If you want to know the price to fill the remainder of the tank, write:

float price = fillUps[i].calculateFillPrice();


Move the code that uses the variables into the class that has the variables.

You can also compare objects, rather than the internal variables. For example:

AnnualFuelUse fillUps[] // ...
AnnualFuelUse minPriceFillUp;

for (int i = 0; i &lt; fillUps.length; i++) {
  if( fillUps[i].exceedsPrice( fillUps[i-1] ) ) {
    maxPriceFillUp = fillUps[i];
  }

  if( fillUps[i].exceedsDistance( fillUps[i-1] ) ) {
    maxDistanceFillUp = fillUps[i];
  }

  // ...
}


At the end of the loop you'll have objects that contain the desired information. With those objects you can then ask them to perform specific tasks. Then make the get accessor methods private.