
what's the logic for create pattern program how can i create any pattern program with in minute. like this
123454321 * 1234 4321 *** 123 321 ***** 12 21 *** 1 1 * 123321 1 1 12 21 1212 2323 1 1 123123 345456 12 21 12341234 5678789 123321 1234512345
etc. i want know that how can i create this program in java without help whats the logic how can i understand that whoe's program code its make this type output

Java Pattern Example
*
* *
* * *
* *
*
public class PatternExample {
public static void main(String[] args) {
int num=3;
int p = num;
int q = 0;
for (int i = 0; i <= num; i++) {
for (int j = p; j>= 1; j-- )
System.out.print(" ");
p-=1;
for (int k = 1; k <= i; k++)
System.out.print ("* ");
System.out.println();
}
num-=1;
for (int i = 0; i<=num; i++) {
for (int j = num; j > i; j--)
System.out.print (" *");
System.out.println();
for (int k = 0; k <= q; k++)
System.out.print(" ");
q+=1;
}
}
}

Java Pattern Example:
123454321
1234 4321
123 321
12 21
1 1
public class PatternExample{
public static void main(String[] args){
int i,j,n=5;
for(i=0;i<=n;i++)
{
System.out.println();
for(j=1;j<=n-i;j++)
System.out.print(j);
for(j=0;j<2*i;j++)
System.out.print(" ");
for(j=n-i;j>0;j--)
System.out.print(j);
}
}
}

#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter no");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=1;j<=n-i;j++)
printf("%d",j);
for(j=0;j<((i*2)-1);j++)
printf("*");
for(j=n-i;j>0;j--)
{
if(j==n)
{
}
else
printf("%d",j);
}
printf("\n");
}}

#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter no");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=1;j<=n-i;j++)
printf("%d",j);
for(j=0;j<((i*2)-1);j++)
printf("*");
for(j=n-i;j>0;j--)
{
if(j==n)
{
}
else
printf("%d",j);
}
printf("\n");
}}

5 5 5 5 5 4 4 4 4 3 3 3 2 2 1
import java.io.*; class reversepattern { public static void main(String args[]) { int i,j; for(i=5;i>=1;i--) { for(j=1;j<=i;j++) { System.out.print(i); System.out.print(" "); } System.out.println(" "); } } }