(int n, int m)
| 1 | public class Patterns { |
| 2 | //Hollow Rectangle |
| 3 | public static void hollowRectangle(int n, int m) { |
| 4 | for(int i=1; i<=n; i++) { |
| 5 | for(int j=1; j<=m; j++) { |
| 6 | if(i == 1 || j == 1 || i == n || j == m) { |
| 7 | System.out.print("*"); |
| 8 | } else { |
| 9 | System.out.print(" "); |
| 10 | } |
| 11 | } |
| 12 | System.out.println(); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | public static void inverted_rotated_halfPyramid(int n) { |
| 17 | for(int i=1; i<=n; i++) { |