Need some help on thus Java Code

Well I don’t understand this code can it be broken down in simple format? And also I want to print it out and format it using printf instead of DF.format. Any help will be highly appreciated. Thankyou

int numberOfAutomobilesCanShip = 0;

numberOfAutomobilesCanShip = MaxNumberOfAutomobiles * NumberOfRailcarsAvailable > numberOfAutomobilesToShip ? numberOfAutomobilesToShip : MaxNumberOfAutomobiles * NumberOfRailcarsAvailable;

System.out.println(“Number of automobiles that can be shipped:\t” + numberOfAutomobilesCanShip + ", " + DF.format(PercentOfAutomobileCanShip));

This is using the ternary operator. e.g.

int myNumber;
if (condition == true) {
myNumber = 25;
} else {
myNumber = 99;
}

…can be written:

int myNumber = (condition == true) ? 25 : 99;

So for the example:
numberOfAutomobilesCanShip = MaxNumberOfAutomobiles * NumberOfRailcarsAvailable > numberOfAutomobilesToShip ? numberOfAutomobilesToShip : MaxNumberOfAutomobiles * NumberOfRailcarsAvailable;

This is the ternary equivalent of the long hand:

int numberOfAutomobilesCanShip = 0;
if (MaxNumberOfAutomobiles * NumberOfRailcarsAvailable > numberOfAutomobilesToShip) {
numberOfAutomobilesCanShip = numberOfAutomobilesToShip;
} else {
numberOfAutomobilesCanShip = MaxNumberOfAutomobiles * NumberOfRailcarsAvailable;
}

Hope that helps a bit.