Pyramid pattern program in java using asterisk

Pyramid pattern program in java using asterisk. Java is used to enforce the right side pattern. Only an asterisk can be printed on the right side of a java application using this programme. In the creation of the Java programming language, the pattern is slightly to the right. A 90° angle can be created by cutting a square corner in half or quartering a circle.

public class Main 
{ 
public static void main(String[] args) 
{ 
int n=5; 
for (int i= 0; i<= n; i++) 
{ 
for (int j=1; j<=n-i; j++) 
{ 
System.out.print(" "); 
} 
for (int k=0;k<=i;k++) 
{ 
System.out.print("*"); 
} 
System.out.println(""); 
} 
} 
} 

Output:

    *                                                                                                                                   

    **                                                                                                                                                     

   ***                                                                                                                                                     

  ****                                                                                                                                                     

 *****                                                                                                                                                     

******