Skip to main content

Posts

Showing posts from December, 2020

Top Patterns in Java Code: How to Print Star(*)/Number/Character

Star Patterns in Java First, let us begin with some of the basic and the commonly asked pattern program in   Java. Such as: Pyramid Star Program, Left Triangle Star Program, Right Triangle Star Program, etc. Below Example prints the star(*), you can replace star to number or character as your wish to print. 1. Pyramid Program: Code: public class Main { public static void main(String[] args) {         for (int i=0; i<5; i++)         {        for (int j=5;j>i;j--)        {             System.out.print(" ");        }        for (int j=0; j<=i; j++ )         {                 System.out.print("*");                 System.out.print(" ");         }    System.out.println();   ...

Contact Me

Name

Email *

Message *