In this tutorial, I will show you have to create a print pyramid using the Java programming language.I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is and

Program Listing

 * Mr. Jake Rodriguez Pomperada,MAED-IT, MIT
 * Bacolod City, Negros Occidental Philippines

import java.util.Scanner;

public class Half_Pyramid {

	 * @param args
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int number = 0;
		Scanner input = new Scanner(;

	    boolean valid;
		do {
	    	 System.out.print("\tPrint Half Pyramid in Java\n\n");
	    	 System.out.print("Enter Number: ");
		     // read the number
		   number = input.nextInt();
		   valid = (number >= 2   && number <= 10);
	       if (!valid) {
	       	System.out.println("\nValues less than 2 or more then 10 are invalid input. Try Again. ");
	       else {
	    	   // outer loop for row
	    	      for (int i=1; i <= number; i++) {
	    	         // inner loop for column
	    	         for(int j=1; j <= i; j++) {
	    	            // print star
	    	            System.out.print("* ");
	    	         // new line
	   }while (!valid);
	  System.out.println("End of Program");
	//close the reader