public class FormattedPrint { public static void main(String[] args) { int [][]b = { {221, 184, 178, 84, 135}, {84, 255, 255, 130, 84}, {78, 255, 0, 0, 78}, {84, 130, 255, 130, 84} }; for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { //Print b[i][j] as integer ("d") within a window of 4 characters long System.out.printf("%4d", b[i][j]); } System.out.println(); } //Print Math.PI as a floating (decimal number)("f") with 5 decimal places within a window of 12 characters long System.out.printf("Pi is %12.5f with five decimal places. ", Math.PI); } } /** >java FormattedPrint 221 184 178 84 135 84 255 255 130 84 78 255 0 0 78 84 130 255 130 84 Pi is 3.14159 with five decimal places. */