This is my code that I used for my program. I’m having difficulties in displaying it the way I want which is without the brackets and commas. I want it to be like pyramids:
    X                                              #      
   XXX                                            ###     
  XXXXX                                          #####    
 XXXXXXX                                        #######   
XXXXXXXXX                                      #########  
My code gives square brackets and commas that I don’t want. I get:
[    X    ,    XXX   ,   XXXXX  ,  XXXXXXX , XXXXXXXXX]  
[]  
[]  
[]  
[]  
[    #    ,    ###   ,   #####  ,  ####### , #########]  
My code:
Stack stackA = new Stack();   
stackA.push("    X    ");
stackA.push("   XXX   ");
stackA.push("  XXXXX  ");
stackA.push(" XXXXXXX ");
stackA.push("XXXXXXXXX");
Stack stackB = new Stack();
Stack stackC = new Stack();
Stack stackD = new Stack();
Stack stackE = new Stack();
Stack stackF = new Stack();
stackF.push("    #    ");
stackF.push("   ###   ");
stackF.push("  #####  ");
stackF.push(" ####### ");
stackF.push("#########");
Stack[] combine = new Stack[6];
combine[0] = stackA;
combine[1] = stackB;
combine[2] = stackC;
combine[3] = stackD;
combine[4] = stackE;
combine[5] = stackF;
for (int i = 0; i < combine.length; i++)
{
    System.out.print(combine[i] + "  ");
    System.out.println();
}
 
     
     
     
     
    