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.

public static String getRectangle(int maxRows, int maxCols, char symbol) - This method

* * * * * * * * * * * * * * * * * * * * * * * * * * 12 x 4 5 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!