Write a program to print the down arrow pattern in java

Write a program to print the down arrow pattern in java. Check out the print down arrow asterisk and number pattern program below in four different ways, each with a sample example and output. We added a compiler at the end of the program so that you can run the following codes.

public class Main
{
public static void main(String[] args)
{
int lines=6;
int i,j;
for(i=1;i<=lines;i++)
{
for(j=1;j<=lines;j++)
{
if(i==j)
System.out.print("*");
else
System.out.print("1");
}
j--;
System.out.print("*");
while(j>=1)
{
if(i==j)
System.out.print("*");
else
System.out.print("1");
j--;
}
System.out.println("");
}
}
}

 

Output:

*11111*11111*
1*1111*1111*1
11*111*111*11
111*11*11*111
1111*1*1*1111
11111***11111