The parameters get swapped but the original arguments are left untouched. Processing uses call by value when passing
arguments, so a copy of the original arguments are swapped not the original arguments themselves.
a) is invalid, first argument must be an int (0.5 is a float)
c) is invalid, first argument must be an int (2.0 is a float)
f) is invalid, first argument must be an int (3L is a long)
void square(int x, int y, int len)
{
rect(x, y, len, len);
}
void printRect (char c, int w, int h)
{
for (int i = 1; i <= h; i++)
{
for (int j = 1; j <= w; j++)
print(c);
println();
}
}
void printRect (char c, int w, int h)
{
for (int i = 1; i <= h; i++)
{
for (int j = 1; j <= w; j++)
if (i == 1 || i == h || j == 1 || j == w)
print(c);
elseprint(" ");
println();
}
}