title: Java string method not returning string
body: <p>I am very new to coding and was just introduced to static methods, so I apologize in advance for the silly mistakes. The method should display a triangle when the method is called under main, but I am getting an empty console and there is no output. However, if I write this under main:</p>
  
  <pre><code>    String triangle = getTriangle(3, 4);    
      System.out.println(triangle);               
  </code></pre>
  
  <p>then, the triangle will be displayed in the console, but for this assignment, the string/triangle must be called by only using 
  <code>getTriangle(maxRows, maxCols)</code></p>
  
  <pre><code>public class Triangle {
  
      public static String getTriangle(int maxRows, int maxCols) {
          String T = "";
  
          if (maxRows &lt; 1 || maxCols &lt; 1) {
              return null;
          } else {
              for (int row = 1; row &lt;= maxRows; row++) {
                  for (int col = 1; col &lt;= row; col++) {
                      T += "*";
                  }
                  T += "\n";  }   
              }
              return T;
          }
      }
  
  
      public static void main(String[] args) {
          getTriangle(3,2);           
  
      }
  
  }
  </code></pre>