25 Different Alphabet Pattern Programs in Java

I have already shared number pattern programs in java. In this article I will be sharing 25 alphabet pattern programs in java. This blog post is one of the best way to start your coding skills in java.
I have taken some alphabet or character pattern programs in java  and tried to solve them. Please add more pattern and code in the comment section.

Read Also :   Number Pattern Programs in Java
                      Star Pattern Programs in Java

Alphabet Pattern Programs in Java - Pattern 1

A
B B
C C C
D D D D
E E E E E
F F F F F F
G G G G G G G



import java.util.Scanner; 
public class MainClass
{
    public static void main(String[] args)
    { 
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
 
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i=0; i<rows; i++)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print((char) alphabet + " ");
            }
            alphabet++;
            System.out.println();
        } 
 
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 2

A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E F G


import java.util.Scanner;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i=0; i< rows; i++)
        {
            for (int j=0; j<=i; j++)
            {
                 System.out.print((char) (alphabet+j) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 3

G
G F
G F E
G F E D
G F E D C
G F E D C B
G F E D C B A



import java.util.Scanner;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i=rows-1; i>=0 ; i--)
        {
            for (int j=rows-1; j>=i; j--)
            {
                 System.out.print((char) (alphabet+j) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}




Alphabet Pattern Programs in Java - Pattern 4

G F E D C B A
G F E D C B
G F E D C
G F E D
G F E
G F
G


import java.util.Scanner;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i=0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>=i; j--)
            {
                 System.out.print((char) (alphabet+j) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 5

A B C D E F G
A B C D E F
A B C D E
A B C D
A B C
A B
A


import java.util.Scanner;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= rows-1; i>=0 ; i--)
        {
            for (int j=0; j<=i; j++)
            {
                 System.out.print((char) (alphabet+j) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 6

A
B C
D E F
G H I J
K L M N O
P Q R S T U
V W X Y Z [ \


import java.util.Scanner;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<=i; j++)
            {
                 System.out.print((char) (alphabet++) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 7

       A
     A B
    A B C
   A B C D
  A B C D E
 A B C D E F
A B C D E F G


import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>i; j--)
            {
                 System.out.print(" ");
            }
            for (int k=0; k<=i; k++)
            {
                 System.out.print((char) (alphabet+k) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 8

A
B A
C B A
D C B A
E D C B A
F E D C B A
G F E D C B A



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=i; j>=0; j--)
            {
                 System.out.print((char) (alphabet + j) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}

Alphabet Pattern Programs in Java - Pattern 9

        A
      ABA
     ABCBA
    ABCDCBA
   ABCDEDCBA
  ABCDEFEDCBA
 ABCDEFGFEDCBA



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>=i; j--)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=i; k++)
            {
                System.out.print((char) (alphabet+k));
            }
            for(int l=i-1; l>=0 ;l--)
            {
                System.out.print((char) (alphabet+l));
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 10

      G
     F G
    E F G
   D E F G
  C D E F G
 B C D E F G
A B C D E F G



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= rows-1; i>= 0 ; i--)
        {
            for (int j=0; j<i; j++)
            {
                System.out.print(" ");
            }
            for (int k=i; k<=rows-1; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}

Alphabet Pattern Programs in Java - Pattern 11

 A B C D E F G
  A B C D E F
   A B C D E
    A B C D
     A B C
      A B
       A



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
         
        //Taking rows value from the user
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");
        
        int alphabet = 65; // ASCII value of alphabet 'A'
        
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=rows-1-i; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println();
        }
        
        //Close the resources
         
        sc.close();
    }
}





Alphabet Pattern Programs in Java - Pattern 12

       A
     B B
    C C C
   D D D D
  E E E E E
 F F F F F F
G G G G G G G


import java.util.*;

public class MainClass

{
    public static void main(String[] args)

    {
        Scanner sc = new Scanner(System.in);
        
        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>i; j--)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=i; k++)
            {
                System.out.print((char) (alphabet + i) + " ");
            }

            System.out.println("");
        }

        //Close the resources

        sc.close();
    }
}



Alphabet Pattern Programs in Java - Pattern 13

A A A A A A A
A A A A A B B
A A A A C C C
A A A D D D D
A A E E E E E
A F F F F F F
G G G G G G G


import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>i; j--)
            {
                System.out.printf("A"+" ");
            }
            for (int k=0; k<=i; k++)
            {
                System.out.print((char) (alphabet + i) + " ");
            }
            System.out.println("");
        }

        //Close the resources

        sc.close();

    }
}

Alphabet Pattern Programs in Java - Pattern 14

A B C D E F G F E D C B A
B C D E F G F E D C B
C D E F G F E D C
D E F G F E D
E F G F E
F G F
G



import java.util.*;

public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=i; j<=rows-1; j++)
            {
                System.out.print((char) (alphabet + j) + " ");
            }
            for (int k=rows-2; k>=i; k--)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println("");
        }

        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 15

   A
   B   H
   C   I   N
   D   J   O   S
   E   K   P   T   W
   F   L   Q   U   X   Z
   G   M   R   V   Y   [   \


import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 1; i<= rows ; i++)
        {
            int count = rows -1;
            int tempVariable = i;
            for (int j=1; j<=i; j++)
            {
                System.out.printf("%4c", (char)tempVariable+alphabet-1);
                tempVariable = tempVariable + count;
                count--;
            }
            System.out.println("");
        }
        
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 16

        A
      A B
     A B C
    A B C D
   A B C D E
  A B C D E F
 A B C D E F G
  A B C D E F
   A B C D E
    A B C D
     A B C
      A B
        A




import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=rows-1; j>=i; j--)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=i; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println("");
        }
        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=-1; j<=i; j++)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=rows-2-i; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println("");
        }

        //Close the resources

        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 17

A B C D E F G
 B C D E F G
  C D E F G
   D E F G
    E F G
     F G
      G
      G
     F G
    E F G
   D E F G
  C D E F G
 B C D E F G
A B C D E F G



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<i; j++)
            {
                System.out.print(" ");
            }
            for (int k=i; k<=rows-1; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println("");
        }
        for (int i= rows-1; i>= 0; i--)
        {
            for (int j=0; j<i; j++)
            {
                System.out.print(" ");
            }
            for (int k=i; k<=rows-1; k++)
            {
                System.out.print((char) (alphabet + k) + " ");
            }
            System.out.println("");
        }

        //Close the resources
        sc.close();
    }
}

Alphabet Pattern Programs in Java - Pattern 18

ABCDEFG
   BCDEFG
      CDEFG
         DEFG
            EFG
               FG
                 G
                 G
               FG
            EFG
         DEFG
      CDEFG
   BCDEFG
ABCDEFG


import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<i; j++)
            {
                System.out.print(" ");
            }
            for (int k=i; k<=rows-1; k++)
            {
                System.out.print((char) (alphabet + k));
            }
            System.out.println("");
        }
        for (int i= rows-1; i>= 0; i--)
        {
            for (int j=0; j<i; j++)
            {
                System.out.print(" ");
            }
            for (int k=i; k<=rows-1; k++)
            {
                System.out.print((char) (alphabet + k));
            }
            System.out.println("");
        }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 19

A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
A B C D E F E D C B A
A B C D E F G F E D C B A



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print((char) (alphabet + j)+ " ");
            }
            for (int k=i-1; k>=0; k--)
            {
                System.out.print((char) (alphabet + k)+ " ");
            }
            System.out.println("");
        }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 20

A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E F G
A B C D E F
A B C D E
A B C D
A B C
A B
A



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= 0; i<= rows-1 ; i++)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print((char) (alphabet + j)+ " ");
            }
            System.out.println("");
        }
        for (int i=rows-1; i>=0; i--)
            {
                for(int j=0; j <= i-1;j++)
                {
                    System.out.print((char) (alphabet + j)+ " ");
                }
                System.out.println("");
            }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 21

G F E D C B A
F E D C B A
E D C B A
D C B A
C B A
B A
A
A
B A
C B A
D C B A
E D C B A
F E D C B A
G F E D C B A



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= rows-1; i>= 0; i--)
        {
            for (int j=i; j>=0; j--)
            {
                System.out.print((char) (alphabet + j)+ " ");
            }
            System.out.println("");
        }
        for (int i=0; i<= rows-1; i++)
            {
                for(int j=i; j >= 0;j--)
                {
                    System.out.print((char) (alphabet + j)+ " ");
                }
                System.out.println("");
            }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 22

A B C D E F G
A B C D E F
A B C D E
A B C D
A B C
A B
A
A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E F G



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'

        for (int i= rows-1; i>= 0; i--)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print((char) (alphabet + j)+ " ");
            }
            System.out.println("");
        }
        for (int i=0; i<= rows-1; i++)
            {
                for(int j=0; j <= i;j++)
                {
                    System.out.print((char) (alphabet + j)+ " ");
                }
                System.out.println("");
            }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 23

        A
     B A B
    C B A B C
   D C B A B C D
  E D C B A B C D E
 F E D C B A B C D E F
G F E D C B A B C D E F G



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'
        int i,j =0;
        for (i= 1; i<= rows; i++)
        {
            for (j=1; j<=rows-i; j++)
            {
                System.out.print(" ");
            }
            for(j=i;j>0;j--)
            {
                System.out.print((char)(j+64)+" ");
            } 
            for(j=2;j<=i;j++)
            {
                System.out.print((char)(j+64)+" ");
            }              
            System.out.println("");
        }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 24

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
A B C D E F G H I J K
A B C D E F G H I J K L M



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'
        int i,j =0;
        for (i= 1; i<= rows; i++)
        {
            for (j=0; j<=(i*2-1); j++)
            {
                System.out.print((char)(j+alphabet)+" ");
            }
            System.out.println("");
        }
        //Close the resources
        sc.close();
    }
}


Alphabet Pattern Programs in Java - Pattern 25

                    A
                  BB
               CCC
            DDDD
           EEEEE
          FFFFFF
   GGGGGGG
 HHHHHHHH



import java.util.*;
public class MainClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        //Taking rows value from the user

        System.out.println("How many rows you want in this pattern?");

        int rows = sc.nextInt();

        System.out.println("Here is your pattern....!!!");

        int alphabet = 65; // ASCII value of alphabet 'A'
        int i,j,k =0;
        for (i= 0; i<= rows; i++)
        {
            for (j=1; j<=rows-i; j++)
            {
                System.out.print(" ");
            }
            for (k=0;k<=i;k++)
            {
                System.out.print((char) (i+alphabet));
            }  
                System.out.println("");
        }
        //Close the resources
        sc.close();
    }
}

Please mention in the comments if you have any questions regarding alphabet pattern programs in java.

About The Author

Subham Mittal has worked in Oracle for 3 years.
Enjoyed this post? Never miss out on future posts by subscribing JavaHungry