Multiple Choice
Consider the following code fragment from the Italian Flag program in How To 3.2: public class ItalianFlagComponent
{
Public void paintComponent(GraphicsG) {
Graphics2D g2 = (Graphics2d) g;
ItalianFlag flag = new ItalianFlag(100, 100, 90) ;
Flag.draw(g2) ;
}
}
Which of the following statements is true?
A) It is impossible to construct an ItalianFlagComponent because no constructor is implemented.
B) It is impossible to add an ItalianFlagComponent object to a frame because the class does not extend JComponent.
C) The code will not compile because it should have called g2.draw(flag) ;
D) The code has a syntax error and will not compile.
Correct Answer:

Verified
Correct Answer:
Verified
Q3: When a method exits, its _ are
Q32: Assuming the following code is the body
Q33: Consider the following method comment and method
Q34: Assume the method below has been added
Q36: We want to create a class that
Q38: What will be output from the following
Q41: Given this method comment, fill in the
Q41: In the statement below, amount is referred
Q43: The black boxes from which a program
Q102: Encapsulation allows a programmer to use a