A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Pattern Making in Java

Program:




class pattern
{
    public static void main(String args[])
    {
        for(int i=0; i<=3; i++)
        {
            System.out.print("  ");
            for(int j=0; j<=i; j++)
            {
               
                System.out.print("*");
            
            }
            System.out.println();
        }
       
        for(int i=0; i<=3; i++)
        {
            for(int j=0; j<=i; j++)
            {
                System.out.print("*");
            }
            System.out.println();
        }
       
        for(int i=3; i>=0; i--)
        {
            for(int j=0; j<=i; j++)
            {
                System.out.print("*");
            }
            System.out.println();
        }
    }  
}



Output:


LEARN TUTORIALS

.

.