Question: public static String getRectangle(int maxRows, int maxCols, char symbol) - This method returns a string with a rectangle that has maxRows and maxCols, using the
public static String getRectangle(int maxRows, int maxCols, char symbol) - This method returns a string with a rectangle that has maxRows and maxCols, using the symbol character. The method will return the special value null (it means nothing or no address) if maxRows or maxCols (or both) are less than 1; in this case no diagram will be generated. The method MUST not rely on System.out.println(). For example, calling DrawingApp.getRectangle(6, 9, '*'); will generate the string:
Write a Java program to match the result as the image shows also meet the requirement of the descption.

* * * * * * * * * * * * * * * * * * * * * * * * * * 12 x 4 5 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
