I am to make this following pattern on a for loop:
XXXXXXXXXX
XXXXXXXXXY
XXXXXXXXYY
XXXXXXXYYY
...
..and so on
public class ex{
    public static void main(String[] args){
            for(int i=0;i<=10;i++){
                    System.out.println();
                    for(int j=0;j<=10;j++){
                            if(i==0){
                                    System.out.print("X");
                            }
                            if(i==1){
                                    System.out.print("X");
                                    if(j==9){
                                            System.out.print("Y");
                                    }
                            }
                    }
            }
    }
} ~
I am getting extra "X" at the end for my output that I don't want. I think there is a better way to do this but can't think of a way right now
Any help guys?