Display following pattern in JAVA
package com.rakesh.sample; /** * @author Rakesh KR * @since December 2k14 */ public class Display { public static void main(String args[]){ String firstPattern = "+-----"; String secondPattern = "| "; for(int i=0; i<10 ; i++){ for(int j=0 ; j<5 ;j++){ System.out.print(firstPattern); } System.out.print("+\n"); for(int j=0 ; j<5 ;j++){ System.out.print(secondPattern); } System.out.print("|\n"); } for(int j=0 ; j<5 ;j++){ System.out.print(firstPattern); } System.out.print("+\n"); } }
Comments
Post a Comment