MCPcopy Create free account
hub / github.com/apna-college/Alpha / hollowRectangle

Method hollowRectangle

0_JavaProgrammingBasics/Patterns/Patterns.java:3–14  ·  view source on GitHub ↗
(int n, int m)

Source from the content-addressed store, hash-verified

1public 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++) {

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.45

Tested by

no test coverage detected