I have a question on how to use printf for multiple formats. I want something like this, where everything inside printf is spaced out evenly:
i i i i i
and this is how I used printf:
// display headers
System.out.printf("", "%15s", "%15s", "%15s", "%15s", "Car Type",
"Starting Miles", "Ending Miles", "Distance/Gallon",
"Gallons/Distance", "Miles/Gallon");
when I executed my program, the above wouldn't show up at all, I just go this:
run:
Gas & Mileage Calculations
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BUILD SUCCESSFUL (total time: 0 seconds)