Introduction |
|
xix | |
Assessment Test |
|
xxv | |
|
Part I The Programmer's Exam |
|
|
1 | (260) |
|
|
3 | (26) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
6 | (3) |
|
|
9 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (2) |
|
|
13 | (3) |
|
|
14 | (1) |
|
Variables and Initialization |
|
|
14 | (2) |
|
Argument Passing: By Reference or By Value |
|
|
16 | (3) |
|
|
19 | (2) |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
24 | (3) |
|
Answers to Review Questions |
|
|
27 | (2) |
|
Operators and Assignments |
|
|
29 | (42) |
|
|
31 | (1) |
|
|
31 | (4) |
|
The Increment and Decrement Operators: ++ and -- |
|
|
32 | (1) |
|
The Unary Plus and Minus Operators: + and - |
|
|
32 | (1) |
|
The Bitwise Inversion Operator: ~ |
|
|
33 | (1) |
|
The Boolean Complement Operator: ! |
|
|
33 | (1) |
|
The Cast Operator: (type) |
|
|
34 | (1) |
|
|
35 | (6) |
|
The Multiplication and Division Operators: * and / |
|
|
35 | (1) |
|
|
36 | (1) |
|
The Addition and Subtraction Operators: + and - |
|
|
37 | (3) |
|
Arithmetic Error Conditions |
|
|
40 | (1) |
|
The Shift Operators: <<, >>, and >>> |
|
|
41 | (6) |
|
|
41 | (1) |
|
Shifting Negative Numbers |
|
|
42 | (3) |
|
Reduction of the Right Operand |
|
|
45 | (1) |
|
Arithmetic Promotion of Operands |
|
|
46 | (1) |
|
|
47 | (4) |
|
Ordinal Comparisons with <, <=, >, and >= |
|
|
47 | (1) |
|
|
48 | (2) |
|
The Equality Comparison Operators: == and != |
|
|
50 | (1) |
|
The Bitwise Operators: &, ^, and | |
|
|
51 | (5) |
|
|
54 | (2) |
|
The Short-Circuit Logical Operators |
|
|
56 | (2) |
|
The Conditional Operator:? |
|
|
58 | (1) |
|
|
59 | (2) |
|
|
60 | (1) |
|
|
61 | (2) |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (3) |
|
Answers to Review Questions |
|
|
68 | (3) |
|
|
71 | (26) |
|
|
72 | (1) |
|
|
72 | (7) |
|
|
73 | (1) |
|
|
73 | (2) |
|
|
75 | (1) |
|
|
76 | (2) |
|
Subclasses and Method Privacy |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (8) |
|
|
79 | (1) |
|
|
80 | (2) |
|
|
82 | (3) |
|
|
85 | (1) |
|
|
85 | (1) |
|
|
86 | (1) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
89 | (1) |
|
|
89 | (1) |
|
|
90 | (5) |
|
Answers to Review Questions |
|
|
95 | (2) |
|
|
97 | (26) |
|
Explicit and Implicit Type Changes |
|
|
98 | (1) |
|
Primitives and Conversion |
|
|
99 | (6) |
|
Primitive Conversion: Assignment |
|
|
99 | (3) |
|
Assignment Conversion, Narrower Primitives, and Literal Values |
|
|
102 | (1) |
|
Primitive Conversion: Method Call |
|
|
103 | (1) |
|
Primitive Conversion: Arithmetic Promotion |
|
|
103 | (2) |
|
|
105 | (2) |
|
Object Reference Conversion |
|
|
107 | (4) |
|
Object Reference Assignment Conversion |
|
|
108 | (2) |
|
Object Method-Call Conversion |
|
|
110 | (1) |
|
|
111 | (4) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
117 | (4) |
|
Answers to Review Questions |
|
|
121 | (2) |
|
Flow Control, Assertions, and Exception Handling |
|
|
123 | (36) |
|
|
124 | (7) |
|
|
124 | (2) |
|
|
126 | (1) |
|
|
126 | (3) |
|
The break and continue Statements in Loops |
|
|
129 | (2) |
|
|
131 | (2) |
|
|
131 | (1) |
|
|
132 | (1) |
|
|
133 | (10) |
|
Flow of Control in Exception Conditions |
|
|
133 | (4) |
|
|
137 | (6) |
|
|
143 | (3) |
|
Assertions and Compilation |
|
|
144 | (1) |
|
Runtime Enabling of Assertions |
|
|
144 | (1) |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
149 | (7) |
|
Answers to Review Questions |
|
|
156 | (3) |
|
|
159 | (34) |
|
Benefits of Object-Oriented Implementation |
|
|
160 | (2) |
|
|
160 | (2) |
|
|
162 | (1) |
|
Implementing Object-Oriented Relationships |
|
|
162 | (1) |
|
Overloading and Overriding |
|
|
163 | (7) |
|
|
164 | (2) |
|
|
166 | (4) |
|
Constructors and Subclassing |
|
|
170 | (3) |
|
|
172 | (1) |
|
|
173 | (10) |
|
The Enclosing this Reference and Construction of Inner Classes |
|
|
175 | (1) |
|
|
176 | (1) |
|
Classes Defined Inside Methods |
|
|
177 | (6) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
185 | (5) |
|
Answers to Review Questions |
|
|
190 | (3) |
|
|
193 | (34) |
|
|
194 | (5) |
|
|
195 | (2) |
|
|
197 | (1) |
|
|
197 | (1) |
|
|
198 | (1) |
|
|
199 | (6) |
|
|
199 | (2) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
202 | (2) |
|
|
204 | (1) |
|
Scheduling Implementations |
|
|
204 | (1) |
|
Monitors, wait(), and notify() |
|
|
205 | (13) |
|
The Object Lock and Synchronization |
|
|
207 | (1) |
|
|
208 | (5) |
|
|
213 | (1) |
|
|
213 | (2) |
|
|
215 | (2) |
|
Another Way to Synchronize |
|
|
217 | (1) |
|
|
218 | (1) |
|
|
219 | (1) |
|
|
220 | (1) |
|
|
221 | (4) |
|
Answers to Review Questions |
|
|
225 | (2) |
|
The java.lang and java.util Packages |
|
|
227 | (34) |
|
|
228 | (1) |
|
|
229 | (2) |
|
|
231 | (3) |
|
|
234 | (7) |
|
|
235 | (3) |
|
|
238 | (2) |
|
String Concatenation the Easy Way |
|
|
240 | (1) |
|
|
241 | (12) |
|
|
242 | (2) |
|
Collections, Equality, and Sorting |
|
|
244 | (1) |
|
|
245 | (1) |
|
Collection Implementations in the API |
|
|
246 | (1) |
|
Collections and Code Maintenance |
|
|
247 | (6) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
256 | (3) |
|
Answers to Review Questions |
|
|
259 | (2) |
|
Part II The Developer's Exam |
|
|
261 | (224) |
|
Taking the Developer's Exam |
|
|
263 | (32) |
|
Are You Ready for the Exam? |
|
|
264 | (2) |
|
|
266 | (2) |
|
Downloading the Assignment |
|
|
266 | (1) |
|
Taking the Follow-up Exam |
|
|
267 | (1) |
|
What the Assignment Covers |
|
|
267 | (1) |
|
How the Assignment and Exam Are Graded |
|
|
268 | (1) |
|
Structure of the Assignment |
|
|
268 | (2) |
|
|
269 | (1) |
|
Example Assignment: Build a Trouble-Ticket System |
|
|
270 | (5) |
|
|
272 | (1) |
|
Database/Server Development |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
275 | (1) |
|
Adhere to Supplied Naming |
|
|
275 | (1) |
|
|
275 | (1) |
|
Use Standard Design Patterns |
|
|
276 | (1) |
|
|
276 | (8) |
|
|
278 | (1) |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
282 | (2) |
|
Preparation for the Follow-up Exam |
|
|
284 | (6) |
|
What Are the Choices for Data Structures? |
|
|
284 | (1) |
|
Is Implementing Runnable Better Than Extending Thread? |
|
|
284 | (1) |
|
How Elaborate Should an Exception Class Structure Get? |
|
|
285 | (1) |
|
How Many Ways Can You Set Up ``Listener'' Relationships? Which One Is Best? |
|
|
285 | (1) |
|
How Do I Know Which Layout Manager to Use? |
|
|
286 | (1) |
|
Which Design Patterns Are Most Useful in This Kind of Project? |
|
|
287 | (1) |
|
When Does It Make Sense to Use protected and default Scope? |
|
|
287 | (2) |
|
Doesn't an Abstract Class Let the Developer Specify More Behavior Than an Interface? |
|
|
289 | (1) |
|
|
290 | (1) |
|
|
291 | (1) |
|
|
291 | (1) |
|
|
292 | (1) |
|
Answers to Review Questions |
|
|
293 | (2) |
|
Creating the User Interface with Swing |
|
|
295 | (42) |
|
Defining the GUI's Requirements |
|
|
297 | (3) |
|
Identifying Needed Components |
|
|
297 | (1) |
|
|
298 | (1) |
|
Isolating Regions of Behavior |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
300 | (2) |
|
|
301 | (1) |
|
getLocation() and setLocation() |
|
|
301 | (1) |
|
setForeground() and setBackground() |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
302 | (14) |
|
|
302 | (3) |
|
|
305 | (9) |
|
|
314 | (2) |
|
|
316 | (7) |
|
|
319 | (4) |
|
|
323 | (4) |
|
|
327 | (2) |
|
|
329 | (3) |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
334 | (1) |
|
Answers to Review Questions |
|
|
335 | (2) |
|
|
337 | (42) |
|
|
338 | (5) |
|
Component Size and Position |
|
|
341 | (2) |
|
|
343 | (31) |
|
|
343 | (2) |
|
|
345 | (2) |
|
The Border Layout Manager |
|
|
347 | (7) |
|
|
354 | (5) |
|
The GridBag Layout Manager |
|
|
359 | (15) |
|
|
374 | (1) |
|
|
375 | (1) |
|
|
375 | (1) |
|
|
376 | (1) |
|
|
377 | (1) |
|
Answers to Review Questions |
|
|
378 | (1) |
|
Writing the Network Protocol |
|
|
379 | (36) |
|
Client-Server from Scratch |
|
|
381 | (14) |
|
|
381 | (3) |
|
Connecting Clients to the Server |
|
|
384 | (1) |
|
|
384 | (3) |
|
The Client Request Structure |
|
|
387 | (7) |
|
|
394 | (1) |
|
Remote Method Invocation (RMI) |
|
|
395 | (7) |
|
|
396 | (1) |
|
|
397 | (4) |
|
|
401 | (1) |
|
|
402 | (8) |
|
|
403 | (7) |
|
|
410 | (1) |
|
|
410 | (1) |
|
|
411 | (1) |
|
|
412 | (1) |
|
Answers to Review Questions |
|
|
413 | (2) |
|
Connecting Client and Server |
|
|
415 | (24) |
|
|
416 | (4) |
|
|
417 | (1) |
|
|
417 | (3) |
|
Using Java Bean Conventions |
|
|
420 | (3) |
|
Java Beans and the MVC Design Pattern |
|
|
423 | (2) |
|
|
425 | (7) |
|
|
432 | (2) |
|
Using Distributed Notification |
|
|
434 | (1) |
|
|
435 | (1) |
|
|
435 | (1) |
|
|
436 | (1) |
|
|
437 | (1) |
|
Answers to Review Questions |
|
|
438 | (1) |
|
Enhancing and Extending the Database |
|
|
439 | (26) |
|
|
440 | (1) |
|
|
441 | (10) |
|
|
442 | (5) |
|
|
447 | (4) |
|
|
451 | (9) |
|
|
451 | (3) |
|
|
454 | (2) |
|
|
456 | (3) |
|
|
459 | (1) |
|
|
460 | (1) |
|
|
460 | (1) |
|
|
461 | (1) |
|
|
462 | (1) |
|
Answers to Review Questions |
|
|
463 | (2) |
|
Building the Database Server |
|
|
465 | (20) |
|
|
466 | (13) |
|
|
467 | (4) |
|
Exporting with UnicastRemoteObject |
|
|
471 | (4) |
|
Exporting an Activatable Object |
|
|
475 | (4) |
|
|
479 | (2) |
|
|
481 | (1) |
|
|
482 | (1) |
|
|
482 | (1) |
|
|
483 | (1) |
|
Answers to Review Questions |
|
|
484 | (1) |
|
|
485 | (20) |
|
|
500 | (5) |
Glossary |
|
505 | (14) |
Index |
|
519 | |