Name:     ID: 
 
Email: 

Java Programming Quiz 3

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

A ____ is an AWT component that serves as an invisible container to further refine the arrangement of components within another Container.
a.
Container
c.
Panel
b.
Frame
d.
Window
 

 2. 

All of the following are assignment operators except ____.
a.
+=
c.
-=
b.
--
d.
%=
 

 3. 

Consider the following for statement: for (int counter = 1; counter < 1; counter --). How many times will the loop execute?
a.
0
c.
2
b.
1
d.
infinite number of times
 

 4. 

A(n) ____ is convenient when assigning values to two-dimensional arrays or when keeping track of a table of numbers.
a.
add-and-assign operator
c.
nested loop
b.
control array
d.
while loop
 

 5. 

The immediate superclass of a TextArea component is ____.
a.
TextContainer
c.
TextComponent
b.
Text
d.
TextField
 

 6. 

The ____ method makes a menu item clickable.
a.
add()
c.
setActionCommand()
b.
addActionListener()
d.
setMenuBar()
 

 7. 

The ____ is an object that implements the WindowListener interface.
a.
WindowAdapter
c.
WindowObject
b.
WindowEvent
d.
EventHandler
 

 8. 

A ____ object resides in a buffer between the clipboard and the calling application.
a.
Clipboard
c.
Transferable
b.
DataFlavor
d.
Toolkit
 

 9. 

The ____ method returns the most recent value of the system clipboard provided by the native platform.
a.
getDefaultToolkit()
c.
getSystemClipboard()
b.
getContents()
d.
getTransferData()
 

 10. 

To represent a null string, type ____.
a.
‘’
c.
“ ”
b.
“”
d.
‘ ’
 

True/False
Indicate whether the statement is true or false.
 

 11. 

In Java, the length of an array is not a method, but a property provided for all arrays.
 

 12. 

The third parameter of a for statement, the counter-control value, can be incremented or decremented by any integer value.
 

 13. 

FlowLayout contains the following alignment constants that can be used as arguments to its constructor: LEFT, CENTER, RIGHT, TOP, and BOTTOM.
 

 14. 

When adding containers to a Frame in its constructor method, the name of the Frame object must be included in front of the add() method.
 

 15. 

The return data type of the getLabel() method is a Label object.
 

Completion
Complete each statement.
 

 16. 

When using a(n) ____________________ in the third parameter of a for loop, the stop value in the second parameter must be less than the initial value in the first parameter in order to avoid an infinite loop.
 

 

 17. 

Stand-alone windowed applications often are called ____________________.
 

 

 18. 

The layout manager, ____________________, places components into one of five geographical regions within the container.
 

 

 19. 

Java supports a(n) ____________________ to create a String representation of each primitive data type.
 

 

 20. 

A(n) ____________________ remains on the screen after the user releases the mouse button.
 

 

 21. 

A container with added components is a(n) ____________________.
 

 

 22. 

The term, ____________________, refers to system dependent implementations of components.
 

 

 23. 

The ____________________ is associated with ActionEvent objects and can be used to compare its return object with another component of the same type.
 

 

 24. 

When using several Frames in an application, use the ____________________ to decide exactly when or what event will make any given Frame visible.
 

 

 25. 

The ____________________ assigns an image to a Frame's title bar icon.
 

 



 
         Start Over