Multiple Choice
Consider the getArea method from the textbook shown below: public int getArea()
{
If (width <= 0) { return 0; } // line #1
If (width == 1) { return 1; } // line #2
Triangle smallerTriangle = new Triangle(width - 1) ; // line #3
Int smallerArea = smallerTriangle.getArea() ; // line #4
Return smallerArea + width; // line #5
}
Assume that line #3 is changed to this:
Triangle smallerTriangle = new Triangle(width) ;
This would cause infinite recursion for ____.
A) triangles with width equal to 0
B) triangles with width equal to 1
C) triangles with width greater than or equal to 2
D) triangles of any width
Correct Answer:

Verified
Correct Answer:
Verified
Q81: Consider the method below, which prints the
Q82: Consider the code for the recursive method
Q83: Why does the best recursive method usually
Q84: In recursion, the terminating condition is analogous
Q85: The string "eat" has _ permutations.<br>A) 2<br>B)
Q87: Complete the code for the calcPower recursive
Q88: Consider the method below, which implements the
Q89: Consider the getArea method from the textbook
Q90: Consider the following code snippet: public static
Q91: Consider the fib method from the textbook