Java programs to print alphabet pattern

Introduction

In this article, I have explained the list of all alphabet pattern programs in java programming language. I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability.

Alphabet pattern : 1

A
BB
CCC
DDDD
EEEEE
import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             System.out.print((char)(i+64));
         }
 
         System.out.println("");
     }
 }
}

Alphabet pattern : 2

AAAAA
BBBB
CCC
DD
E

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
 
     for(i=1;i<=n;i++)
     {
         for(j=i;j<=n;j++)
         {
             System.out.print((char)(i+64));
         } 
         System.out.println("");
     }
 }
 
}

Alphabet pattern : 3

A
AB
ABC
ABCD
ABCDE
import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5; 
 
     for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
 
}

Alphabet pattern : 4

E
DE
CDE
BCDE
ABCDE

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5; 
 
     for(i=n;i>=1;i--)
     {
         for(j=i;j<=n;j++)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
 
}

Alphabet pattern : 5

A
BA
CBA
DCBA
EDCBA
import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5; 
 
     for(i=1;i<=n;i++)
     {
         for(j=i;j>=1;j--)
         {
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
 
}

Alphabet pattern : 6

E
ED
EDC
EDCB
EDCBA

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=n;i>=1;i--)
     {
         for(j=n;j>=i;j--)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }

Alphabet pattern 7

E
DD
CCC
BBBB
AAAAA

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5; 
 
     for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             System.out.print((char)(n-i+1+64));
         }
 
         System.out.println("");
     }
 }
}

Alphabet pattern 8

EEEEE
DDDD
CCC
BB
A

import java.util.*;
 
class ap2
{
 public static void main(String args[])
 {
 int i,j;
 
 int n=5;
 
     for(i=n;i>=1;i--)
     {
         for(j=1;j<=i;j++)
         {
             System.out.print((char)(i+64));
         }
         System.out.println("");
     }
 }
}

Also check

 All star patterns using java programming Language

 All numbers patterns using Java programming Language


Alphabet pattern 9

EDCBA
EDCB
EDC
ED
E

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=n;j>=i;j--)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
 
}

Alphabet pattern 10

EDCBA
DCBA
CBA
BA
A

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=n;i>=1;i--)
     {
         for(j=i;j>=1;j--)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 11

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
 
        for(j=1;j<=n-i;j++)
         {
     System.out.printf(" ");
 } 
        for(j=1;j<=i;j++)
         {
     System.out.printf("%c",(char)(j+64));
 } 
        for(j=i-1;j>=1;j--)
         {
     System.out.printf("%c",(char)(j+64));
 } 
 
         System.out.println();
     }
 }
}

Alphabet pattern 12

A B C D E
A B C D
A B C
A B
A

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=1;j<=n-i+1;j++)
         {
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 13

A
B A
C B A
D C B A
E D C B A

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=i;j>=1;j--)
         {
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 14

E D C B A
D C B A
C B A
B A
A

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=n;i>=1;i--)
     {
         for(j=i;j>=1;j--)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 15

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
 
        for(j=1;j<=n-i;j++)
         {
     System.out.printf(" ");
 } 
        for(j=1;j<=i;j++)
         {
     System.out.printf("%c",(char)(j+64));
 } 
        for(j=i-1;j>=1;j--)
         {
     System.out.printf("%c",(char)(j+64));
 } 
 
         System.out.println();
     }
 }
}

Alphabet pattern 16

A
B C
D E F
G H I J
K L M N O

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5,k=1;
 
     System.out.println("Floyd's Triangle using alphabets/characters");
     for(i=1;i<=n;i++)
     {
        for(j=1;j<=i;j++,k++)
         {
             System.out.printf("%4c",(char)(k+64));
         }
 
         System.out.println("");
     }
 }
}

Alphabet pattern 17

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
 
        for(j=1;j<=n-i;j++)
         {
     System.out.printf("  ");
 } 
        for(j=i;j>0;j--)
         {
     System.out.printf(" %c",(char)(j+64));
 } 
        for(j=2;j<=i;j++)
         {
     System.out.printf(" %c",(char)(j+64));
 } 
 
         System.out.println();
     }
 }
}

Alphabet pattern 18

A
B F
C G J
D H K M
E I L N O

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 int diff,value; 
 
     for(i=1;i<=n;i++)
     {
 diff=n-1;
 value=i;
        for(j=1;j<=i;j++)
         {
             System.out.printf("%4c", (char)value+64);
         value=value+diff; 
             diff--;
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 19

A
A B C
A B C D E
A B C D E F G
A B C D E F G H I

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=1;j<=(i*2-1);j++)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 20

E F G H I
D E F G
C D E
B C
A

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j,k;
 int n=5;
 
     for(i=n;i>=1;i--)
     {
 k=i;
         for(j=1;j<=i;j++,k++)
         { 
             System.out.print((char)(k+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 21

A B C D E
B C D E
C D E
D E
E

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
         for(j=i;j<=n;j++)
         { 
             System.out.print((char)(j+64));
         } 
         System.out.println("");
     }
 }
}

Alphabet pattern 22

import java.util.*;
 
class JavaApplication2
{
 public static void main(String args[])
 {
 int i,j,k;
 int n=5;
 
     for(i=1;i<=n;i++)
     {
 
        for(j=1;j<=n-i;j++)
         {
 System.out.print(" ");
         } 
        for(k=1;k<=i;k++)
         {
 System.out.print((char)(i+64));
         } 
 
         System.out.println("");
     }
 }
}

 

Leave a Comment