Java Reference
In-Depth Information
Understanding Error Messages
Locate the file named Errors in the Chapter04 folder on the Data Disk. Start
TextPad and open the file. Compile the program. Using what you know about
coding and error messages, list the possible coding errors that might cause
TextPad to display the error messages. Or, if your instructor directs you to do
so, fix the errors and submit a copy of the program to your instructor.
Short Answer
1 . A ( n ) ________________ C h e c k b ox i n a C h e c k b ox G r oup can be used to clear
others in the mutually exclusive set.
2. A statement is referred to as ________________ when it is located completely
within another statement.
3. Java uses a(n) ________________ statement to evaluate a value for the case
statement.
4. You can use the ________________ m e t h o d t o p o s i t i o n the insertion point in a
TextField.
5. If the left side of the ________________ o p e r a t o r e v a l u a t e s t o false, then the
right side is not evaluated. If the left side of the ________________ o p e r a t o r
evaluates to true, then the right side is not evaluated.
6 . T h e ________________ t y pically contains code to perform any cleanup that
might be necessary after executing the try statement and catch statement.
7. A(n) ________________ displays as option buttons in the user interface of a
Java applet.
8. An operation that attempts to use a float value in a location declared to be
an integer is an example of a(n) ________________.
9. A(n) ________________ check might be used to ensure that data input by the
user fits the program's specifications for a correct data type.
10. Conditions in Java are ________________ e x p r essions that evaluate to true or
false.
11. A control structure that allows for more than two choices when a condition
is evaluated is called a(n) ________________.
12. When a Checkbox is clicked, the ________________ m e t h o d i s c a l l e d .
13. Study the following conditions and determine whether they evaluate to true
or false. In those examples that display more than one condition, tell which
condition confirms the true or false state.
a. 25 == 25
b. (18 < 19) && (12 > 14)
c. (18 < 19) || (12 > 14)
d. 31 <= 31
e. !(5 == 5)
f. (a == a) || (b = = b) || (c = = c)
g. !((14 > 12) && (27 > = 26))
h. (45 < 55) && (55 > 45)
(continued)
Search WWH ::




Custom Search