I find this super fun creating square pattern while I was learning For loop in JAVA. And I think it might be help full to some beginners

Update Size

Feel free to update the size to print any size square box.

double size = 5; //you can change it

Sample output

* * * * * *
*         *
*         *
*         *
* * * * * *

Coding is fun !