/* Java program from Chapter 1 of Reges & Stepp. ** The program, like its predecessor (DrawBoxes) "draws" two boxes. ** However, here redundancy is avoided --and procedural decomposition ** is applied-- by placing the block of four statements that draws a ** box into its own method, which is called twice from main(). */ public class DrawBoxes2 { public static void main(String[] args) { drawBox(); System.out.println(); drawBox(); } public static void drawBox() { System.out.println("+------+"); System.out.println("| |"); System.out.println("| |"); System.out.println("+------+"); } }