public class Program
{
private static void print_hollow_rectangle(int total_stars) {
for (int i = 1; i <= total_stars; i++) {
for (int j = 1; j <= total_stars; j++) {
if (i == 1 || i == total_stars || j == 1 || j == total_stars) {
System.out.print("*");
}
else {
System.out.print(" ");
}
}
System.out.println();
}
}
public static void main(String[] args)
{
print_hollow_rectangle(7);
}
}
/*
run:
*******
* *
* *
* *
* *
* *
*******
*/