Introduction |
|
xxi | |
Assessment Test |
|
xxxi | |
|
Chapter 1 Java Building Blocks |
|
|
1 | (50) |
|
Understanding the Java Class Structure |
|
|
2 | (4) |
|
|
2 | (2) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
6 | (3) |
|
Understanding Package Declarations and Imports |
|
|
9 | (7) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
13 | (3) |
|
Code Formatting on the Exam |
|
|
16 | (1) |
|
|
16 | (4) |
|
|
17 | (1) |
|
Reading and Writing Object Fields |
|
|
18 | (1) |
|
Instance Initializer Blocks |
|
|
18 | (1) |
|
|
19 | (1) |
|
Distinguishing Between Object References and Primitives |
|
|
20 | (5) |
|
|
20 | (4) |
|
|
24 | (1) |
|
|
25 | (1) |
|
Declaring and Initializing Variables |
|
|
25 | (4) |
|
Declaring Multiple Variables |
|
|
26 | (1) |
|
|
27 | (2) |
|
Understanding Default Initialization of Variables |
|
|
29 | (2) |
|
|
29 | (1) |
|
Instance and Class Variables |
|
|
30 | (1) |
|
Understanding Variable Scope |
|
|
31 | (3) |
|
Ordering Elements in a Class |
|
|
34 | (2) |
|
|
36 | (3) |
|
|
36 | (2) |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
41 | (1) |
|
|
42 | (9) |
|
Chapter 2 Operators and Statements |
|
|
51 | (50) |
|
Understanding Java Operators |
|
|
52 | (1) |
|
Working with Binary Arithmetic Operators |
|
|
53 | (4) |
|
|
53 | (2) |
|
|
55 | (2) |
|
Working with Unary Operators |
|
|
57 | (3) |
|
Logical Complement and Negation Operators |
|
|
57 | (1) |
|
Increment and Decrement Operators |
|
|
58 | (2) |
|
Using Additional Binary Operators |
|
|
60 | (6) |
|
|
60 | (2) |
|
Compound Assignment Operators |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (1) |
|
Understanding Java Statements |
|
|
66 | (20) |
|
|
67 | (1) |
|
The if-then-else Statement |
|
|
68 | (4) |
|
|
72 | (4) |
|
|
76 | (2) |
|
|
78 | (2) |
|
|
80 | (6) |
|
Understanding Advanced Flow Control |
|
|
86 | (6) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
88 | (2) |
|
|
90 | (2) |
|
|
92 | (1) |
|
|
92 | (2) |
|
|
94 | (7) |
|
|
101 | (64) |
|
Creating and Manipulating Strings |
|
|
102 | (9) |
|
|
102 | (2) |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
105 | (5) |
|
|
110 | (1) |
|
Using the StringBuilder Class |
|
|
111 | (6) |
|
|
112 | (1) |
|
|
113 | (1) |
|
Important StringBuilder Methods |
|
|
114 | (3) |
|
StringBuilder vs. StringBuffer |
|
|
117 | (1) |
|
|
117 | (2) |
|
Understanding Java Arrays |
|
|
119 | (10) |
|
Creating an Array of Primitives |
|
|
119 | (2) |
|
Creating an Array with Reference Variables |
|
|
121 | (2) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
126 | (1) |
|
|
126 | (3) |
|
Understanding an Array List |
|
|
129 | (9) |
|
|
129 | (1) |
|
|
130 | (4) |
|
|
134 | (2) |
|
|
136 | (1) |
|
Converting Between array and List |
|
|
136 | (2) |
|
|
138 | (1) |
|
Working with Dates and Times |
|
|
138 | (13) |
|
|
138 | (4) |
|
Manipulating Dates and Times |
|
|
142 | (3) |
|
|
145 | (3) |
|
Formatting Dates and Times |
|
|
148 | (3) |
|
|
151 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (12) |
|
Chapter 4 Methods and Encapsulation |
|
|
165 | (68) |
|
|
166 | (6) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
172 | (1) |
|
Applying Access Modifiers |
|
|
173 | (15) |
|
|
173 | (2) |
|
Default (Package Private) Access |
|
|
175 | (1) |
|
|
176 | (4) |
|
|
180 | (1) |
|
Designing Static Methods and Fields |
|
|
181 | (1) |
|
Calling a Static Variable or Method |
|
|
182 | (1) |
|
|
183 | (2) |
|
|
185 | (1) |
|
|
186 | (1) |
|
|
187 | (1) |
|
Passing Data Among Methods |
|
|
188 | (3) |
|
|
191 | (5) |
|
|
196 | (9) |
|
|
197 | (2) |
|
|
199 | (3) |
|
|
202 | (1) |
|
|
202 | (3) |
|
|
205 | (3) |
|
Creating Immutable Classes |
|
|
207 | (1) |
|
|
208 | (7) |
|
|
209 | (2) |
|
|
211 | (3) |
|
|
214 | (1) |
|
|
215 | (1) |
|
|
216 | (2) |
|
|
218 | (15) |
|
|
233 | (66) |
|
Introducing Class Inheritance |
|
|
234 | (25) |
|
|
235 | (2) |
|
Applying Class Access Modifiers |
|
|
237 | (1) |
|
|
237 | (1) |
|
|
238 | (6) |
|
Calling Inherited Class Members |
|
|
244 | (2) |
|
|
246 | (11) |
|
|
257 | (2) |
|
Creating Abstract Classes |
|
|
259 | (7) |
|
Defining an Abstract Class |
|
|
260 | (2) |
|
Creating a Concrete Class |
|
|
262 | (1) |
|
Extending an Abstract Class |
|
|
263 | (3) |
|
|
266 | (13) |
|
|
267 | (2) |
|
|
269 | (4) |
|
|
273 | (1) |
|
Default Interface Methods |
|
|
274 | (4) |
|
|
278 | (1) |
|
Understanding Polymorphism |
|
|
279 | (9) |
|
|
281 | (1) |
|
|
282 | (2) |
|
|
284 | (1) |
|
|
285 | (2) |
|
Polymorphism and Method Overriding |
|
|
287 | (1) |
|
|
288 | (1) |
|
|
289 | (2) |
|
|
291 | (8) |
|
|
299 | (34) |
|
|
300 | (5) |
|
|
300 | (2) |
|
Understanding Exception Types |
|
|
302 | (2) |
|
|
304 | (1) |
|
|
305 | (8) |
|
|
307 | (2) |
|
Catching Various Types of Exceptions |
|
|
309 | (2) |
|
Throwing a Second Exception |
|
|
311 | (2) |
|
Recognizing Common Exception Types |
|
|
313 | (5) |
|
|
314 | (3) |
|
|
317 | (1) |
|
|
317 | (1) |
|
Calling Methods That Throw Exceptions |
|
|
318 | (5) |
|
|
319 | (2) |
|
|
321 | (2) |
|
|
323 | (1) |
|
|
324 | (1) |
|
|
325 | (8) |
|
Appendix A Answers to Review Questions |
|
|
333 | (20) |
|
Chapter 1 Java Building Blocks |
|
|
334 | (2) |
|
Chapter 2 Operators and Statements |
|
|
336 | (3) |
|
|
339 | (3) |
|
Chapter 4 Methods and Encapsulation |
|
|
342 | (4) |
|
|
346 | (3) |
|
|
349 | (4) |
|
|
353 | (14) |
|
|
354 | (5) |
|
|
354 | (1) |
|
Creating and Running Sample Applications |
|
|
355 | (4) |
|
|
359 | (8) |
|
Understanding the Question |
|
|
359 | (3) |
|
Applying Process of Elimination |
|
|
362 | (2) |
|
|
364 | (2) |
|
Getting a Good Night's Rest |
|
|
366 | (1) |
Index |
|
367 | |