// Variation of the Diamond1 program that uses a constant to allow for resizing // the diamond output. public class Diamond2 { public static final int SIZE = 8; public static void main(String[] args) { for (int row = 1; row <= SIZE; row++) { for (int space = 1; space <= SIZE - row; space++) { System.out.print(" "); } System.out.print("/"); for (int dot = 1; dot <= 2 * row - 2; dot++) { System.out.print("."); } System.out.println("\\"); } for (int row = SIZE; row >= 1; row--) { for (int space = 1; space <= SIZE - row; space++) { System.out.print(" "); } System.out.print("\\"); for (int dot = 1; dot <= 2 * row - 2; dot++) { System.out.print("."); } System.out.println("/"); } } }