Java Reference
In-Depth Information
Short Answer (continued)
5 . ________________ o p e r a t o r s w o r k differently when placed before, rather than
after, an operand.
6. The for statement parameters are separated by ________________.
7 . T h e ________________ c o m p o n e n t p r e s e nts a drop-down list of items from
which a user can choose.
8 . T h e ________________ m e t h o d a dds a new data element to a choice component.
9. Which of the following declares an array of int named scores?
a. int scores; b. int[] scores;
c. new int scores[]; d. int scores = int[];
10. What are the legal index numbers for the array, evenNumbers, given the
declaration, int[] evenNumbers = {2, 4, 6, 8}?
a. 0, 1, 2, 3 b. 1, 2, 3, 4
c. 2, 4, 6, 8 d. all even numbers
11. For which of the following applications is an array NOT suitable?
a. storing the scores on 12 midterm exams of a class
b. storing the name, social security number, age, and income of one individual
c. storing the temperature readings taken every hour throughout a day
d. storing a list of animals at the local zoo
12. Which of the following initializes an instance variable?
a. a constructor method b. an overload
c. an initializer d. a for statement
1 3 . A ( n ) ________________ s t o r e s data in a contiguous block of memory, divided
into a number of slots.
a. overload b. array
c. element d. constructor
14. Which of the following is NOT an assignment operator?
a. += b. =\
c. *= d. /=
15. In the line of code setLayout(new BorderLayout(10,8); the arguments
of the constructor for the BorderLayout() class represent ________________.
a. pixels b. rows and columns
c. twips d. array indices
16. The setEditable() method takes a(n) ________________ argument.
a. String b. boolean
c. int d. read/write
17. The method that governs the action taken when a user clicks the Close
button is called the ________________ m e t h o d .
a. Close()
b. windowMethod()
c. closeWindow()
d. windowClosing()
Search WWH ::




Custom Search