Code: Java
for(int i = 0;i<n;i++)
{
    for(int i = 0;i<n;i++)
    {
        System.Out.Print("#");
    }
}
Instead of printing you can even get them into a two dimensional array.