Program to print the diamond pattern program using numbers in java

Program to print the diamond pattern program using numbers in java. In the Java programming language, the diamond number pattern is used. In this Java  program, the number will be printed in a diamond form. For beginners, a diamond pattern   software that prints the number in a diamond shape is available.

public class Main
{ 
public static void main(String[] args) 
{ 
for (int i = 1; i <= 4; i++) 
{ 
int n = 10; 
for (int j = 1; j<= n - i; j++) 
{ 
System.out.print(" "); 
} 
for (int k = i; k >= 1; k--) 
{ 
System.out.print(k); 
} 
for (int l = 2; l <= i; l++) 
{ 
System.out.print(l); 
} 
System.out.println(); 
} 
for (int i = 3; i >= 1; i--) 
{ 
int n = 9; 
for (int j = 0; j<= n - i; j++) 
{ 
System.out.print(" "); 
} 
for (int k = i; k >= 1; k--) 
{ 
System.out.print(k); 
} 
for (int l = 2; l <= i; l++) 
{ 
System.out.print(l); 
} 
System.out.println(); 
} 
} 
}

Output   

            1                                                        

        212                                                                                                                                              

       32123                                                                                                                                             

      4321234                                                                                                                                            

       32123                                                                                                                                             

        212                                                                                                                                              

         1