Write a Java program to draw reverse pyramid pattern

Write a Java program to draw a pattern like mentioned below:

Java Program - Reverse Pyramid


public class DrawPattern6 {

	public static void main(String[] args) {
		int n = 5;
		for (int i = n - 1; i > 0; i--) {
			for (int j = 1; j <= n - i; j++)

			{
				System.out.print(" ");
			}
			for (int j = 1; j <= i * 2 - 1; j++)

			{
				System.out.print("*");
			}
			System.out.println();
		}

	}
}

Author: Mahesh

Technical Lead with 10 plus years of experience in developing web applications using Java/J2EE and web technologies. Strong in design and integration problem solving skills. Ability to learn, unlearn and relearn with strong written and verbal communications.