
Dear Friends, I am new to java and i faced one program.Can any one just help me getting output for this program given below:
a a b a b c a b c d a b c d e a b c d e f a b c d e a b c d a b c a b a
how can we get this out using for loop.please help me.Thank you!!!

Dear Friends, I am new to java and i faced one program.Can any one just help me getting output for this program given below:
a
a b
a b c
a b c d
a b c d e
a b c d e f
a b c d e
a b c d
a b c
a b
a
Its a triangle program.how can we get this out using for loop.please help me.Thank you!!!

public class Pattern{
public static void main(String []args){
for(int i=97;i<=102;i++){
for(int j=97;j<=i;j++){
System.out.print((char)j);
}
System.out.println();
}
for(int j=102;j>=97;j--){
for(int i=97;i<j;i++) {
System.out.print((char)i);
}
System.out.println();
}
}
}

import java.io.*;
class Triangle1{
void display(){
int i,j,k,m=5;
char a;
for(i=1;i<=5;i++){
a='a';
for(j=m;j>=1;j--)
System.out.print(" ");
for(k=1;k<=i;k++)
System.out.print(a++ +" ");
m--;
System.out.println();
}
m=2;
for(i=4;i>=1;i--){
a='a';
for(j=m;j>=1;j--)
System.out.print(" ");
for(k=1;k<=i;k++)
System.out.print(a++ +" ");
m++;
System.out.println();
}
}
}
class Triangle{
public static void main(String args[]){
Triangle1 tr=new Triangle1();
tr.display();
}
}

Thank you my friend this would really help me.Thank you so much!!!!