Reverse Pyramid Star Pattern in Java

thumbnail

In this tutorial, you will learn to create reverse pyramid star pattern in java. The source code of reverse pyramid star pattern is show below.

package patternchallenge;
public class PatternChallenge {
    public static void main(String[] args) {
        PatternPyramid patternPyramid = new PatternPyramid();
        patternPyramid.reversedPyramidPattern(5);
    }
}
package patternchallenge;
public class PatternPyramid {
    public void reversedPyramidPattern(int n){  
        for (int i= 0; i<= n-1 ; i++)
        {
            for (int j=0; j<=i; j++)
            {
                System.out.print(" ");
            }
            for (int k=0; k<=n-1-i; k++)
            {
                System.out.print("*" + " ");
            }
            System.out.println();
        }
    }
}
 * * * * * 
  * * * * 
   * * * 
    * * 
     * 
Back To Top