Introduction | p. xxiii |
Introduction To Java | p. 1 |
Java Design Principles | p. 2 |
History Of Java | p. 3 |
Java Tools | p. 4 |
The Java Virtual Machine | p. 4 |
The Java Development Kit | p. 4 |
Java Documentation | p. 5 |
Sun's Java Certification Exam | p. 5 |
Signing Up With Sun | p. 5 |
Signing Up With Sylvan Prometric | p. 6 |
Taking The Test | p. 7 |
Get A Java Job | p. 7 |
Chapter Summary | p. 7 |
Hands-On Projects | p. 8 |
Case Projects | p. 11 |
Java Language Fundamentals | p. 13 |
The Structure Of Java Programs | p. 14 |
Packages, Import Statements, And Class Names | p. 15 |
Access Modifiers And Packages | p. 16 |
Java Reserved Words | p. 17 |
Java Identifiers | p. 18 |
Java Variables And Data Types | p. 18 |
Primitive Variables | p. 18 |
The Integer Primitives | p. 18 |
Representing Integer Primitives | p. 19 |
The char Primitive | p. 21 |
The Floating-Point Primitives | p. 22 |
The boolean Primitives | p. 23 |
Classes Easily Confused With Primitives | p. 23 |
Reference Variables | p. 23 |
Array Variables | p. 24 |
Class Basics | p. 25 |
Inner Classes | p. 25 |
Methods | p. 25 |
Constructing An Object | p. 27 |
Interface Basics | p. 28 |
Sun's Java Development Kit | p. 28 |
The Java Compiler | p. 29 |
Source-Code Directories And Packages | p. 29 |
Source-Code Comments | p. 30 |
Conventions For Applications | p. 30 |
An Example Application | p. 30 |
Console Applications | p. 33 |
Conventions For Applets | p. 33 |
[PARAM] Tags | p. 34 |
Applet Method Conventions | p. 35 |
JavaDoc Format Documentation | p. 35 |
Chapter Summary | p. 37 |
Review Questions | p. 37 |
Hands-On Projects | p. 42 |
Case Projects | p. 45 |
Java Operators With Primitives And Objects | p. 47 |
Numeric Operators | p. 48 |
Increment And Decrement | p. 48 |
Unary + And - Operators | p. 49 |
Arithmetic Operators * / % + And - | p. 49 |
Arithmetic Errors | p. 52 |
The Modulo Operator | p. 54 |
Numeric Comparisons | p. 54 |
Logical And Bitwise Operators | p. 54 |
Bitwise Operations With Integers | p. 54 |
Logical Operators | p. 58 |
The Conditional Operators andand And | p. 59 |
Logical Operations With Objects | p. 60 |
The instanceof Operator | p. 60 |
Using == And equals With Objects | p. 62 |
Some equals And == Pitfalls | p. 62 |
String Operators--A Special Case | p. 64 |
Strings Are Immutable | p. 64 |
The toString Method | p. 65 |
Expression Evaluation | p. 65 |
Examples | p. 66 |
Casting And Converting OF References | p. 66 |
Narrowing Conversions Of References | p. 67 |
Summary Of Allowed Reference Conversions | p. 67 |
Array Declaration, Initialization, And Conversion | p. 68 |
Common Pitfalls In Initializing Arrays | p. 69 |
Casting And Converting Arrays | p. 69 |
Chapter Summary | p. 70 |
Review Questions | p. 70 |
Hands-On Projects | p. 76 |
Case Project | p. 83 |
Creating Java Classes | p. 85 |
Creating Java Classes | p. 86 |
Declaring A Java Class | p. 86 |
The Class Body | p. 90 |
Constructors | p. 98 |
Declaring A Constructor | p. 99 |
Static Members And Variables | p. 102 |
Static Fields | p. 102 |
Static Methods | p. 104 |
Static Constructors | p. 106 |
The this Keyword | p. 107 |
Automatic Variables | p. 110 |
Initialization of Automatic Variables | p. 112 |
Variable Hiding | p. 112 |
Local Variable Declaration | p. 113 |
Method Signatures | p. 113 |
Inner Classes | p. 114 |
Nested Top-Level Classes And Interfaces | p. 115 |
Member Classes | p. 116 |
Local Classes | p. 117 |
Anonymous Classes | p. 117 |
Chapter Summary | p. 118 |
Review Questions | p. 119 |
Hands On Projects | p. 126 |
Case Projects | p. 132 |
Flow Control And Exceptions | p. 135 |
Loops With for, while, And do | p. 136 |
The for Loop | p. 136 |
Using do And while | p. 137 |
The break And continue Statements In Loops | p. 137 |
Branching With if - else And switch | p. 140 |
Flow Control With switch - case | p. 141 |
Summary Of Basic Flow Control | p. 142 |
Exceptions, Errors, And Flow Control | p. 142 |
The Throwable Class | p. 143 |
Handling Exceptions With try And catch | p. 143 |
Exceptions, try, catch, And finally | p. 146 |
Exceptions On Top Of Exceptions | p. 147 |
Designing Programs With Exceptions | p. 147 |
Checked Or Unchecked Exceptions? | p. 147 |
Chapter Summary | p. 148 |
Review Questions | p. 148 |
Hands-On Projects | p. 156 |
Case Projects | p. 163 |
Program Architecture With Java Classes And Objects | p. 165 |
Extending Classes And Implementing Interfaces | p. 166 |
Examples From The Standard Library | p. 166 |
Example From The Testing Applet | p. 166 |
Why Implement Runnable? | p. 168 |
Extending The Quest Class | p. 168 |
Benefits Of This Architecture | p. 168 |
Overriding Methods | p. 169 |
Restrictions On Overriding Methods | p. 169 |
Accessing The Overriden Method | p. 171 |
Overriding Variables | p. 171 |
Overloading Methods | p. 172 |
Overloading Constructors | p. 172 |
Abstract Classes In Program Design | p. 173 |
Extending An Abstract Class | p. 173 |
More About Interfaces | p. 174 |
Defining Constants In Interfaces | p. 175 |
Subclassing Interfaces | p. 175 |
Interfaces In The Standard Library | p. 175 |
The Class Class | p. 175 |
Dynamic Class Loading | p. 176 |
The Reflection API | p. 176 |
The final Problem | p. 176 |
Design Patterns And Java | p. 177 |
The Singleton Pattern | p. 177 |
The Model-View-Controller Pattern | p. 178 |
The Observer-Observable Pattern | p. 178 |
The Decorator Pattern | p. 178 |
Memory Management In Java | p. 179 |
What Is An Unreachable Object? | p. 180 |
The Programmer's View Of Memory Management | p. 180 |
Finalizers And Program Design | p. 181 |
Memory Limits | p. 182 |
Chapter Summary | p. 183 |
Review Questions | p. 183 |
Hands-On Projects | p. 189 |
Case Projects | p. 195 |
Java Threads | p. 197 |
Multitasking Vs. Multithreading | p. 198 |
The Thread Class | p. 198 |
The Thread Life-Cycle | p. 198 |
Creating A New Thread | p. 199 |
Static Methods Of The Thread Class | p. 202 |
More Thread Methods | p. 203 |
I/O Processes And Threads | p. 204 |
The Death Of A Thread | p. 205 |
Thread Groups | p. 205 |
Synchronizing Objects And Threads | p. 206 |
The synchronized Keyword | p. 206 |
Examples From The Standard Library | p. 207 |
Which Object To Synchronize On | p. 208 |
Objects Not To Synchronize On | p. 208 |
What About static Methods? | p. 209 |
Using wait And notify | p. 209 |
Using wait With A Timeout | p. 210 |
The InterruptedException | p. 210 |
Hazards Of Thread Programming | p. 211 |
Deadlock Situations | p. 211 |
Use Of The System Thread | p. 211 |
Exceptions Associated With Threads | p. 212 |
Chapter Summary | p. 212 |
Review Questions | p. 212 |
Hands-On Projects | p. 217 |
Case Projects | p. 224 |
Standard Java Library | p. 225 |
The Core Classes | p. 226 |
The Object Class | p. 226 |
The Class Class | p. 228 |
The String Class | p. 228 |
The StringBuffer Class | p. 229 |
The Primitive Wrapper Classes | p. 229 |
The Math Class | p. 231 |
The System Class | p. 232 |
The Runtime Class | p. 234 |
The Extended Math Classes | p. 235 |
The BigDecimal Class | p. 235 |
The BigInteger Class | p. 235 |
The Utility Classes | p. 235 |
Using Properties Objects | p. 235 |
The Locale Class | p. 236 |
The Calendar And Date Classes | p. 237 |
Using A StringTokenizer | p. 237 |
The Original Collections | p. 238 |
The Hashtable Class | p. 239 |
The Vector Class | p. 242 |
The Advanced Collections Classes | p. 244 |
The Interfaces | p. 244 |
The Abstract Classes | p. 247 |
Some Concrete Collection Classes | p. 248 |
Utility Classes That Work With Collection Classes | p. 248 |
Chapter Summary | p. 250 |
Review Questions | p. 250 |
Hands-On Projects | p. 254 |
Case Projects | p. 262 |
Java AWT And JFC Components | p. 263 |
An Overview Of Java Graphic Interfaces | p. 264 |
Java 1.0:The First AWT | p. 264 |
Java 1.1:Improved Event Handling | p. 264 |
Java 1.1:Name Changes And Deprecated Methods | p. 265 |
Java 1.1:The Java Foundation Classes And Swing | p. 265 |
The Java AWT Package | p. 266 |
The Component Class | p. 267 |
Interfaces Implemented By Component | p. 267 |
Appearance-Related Properties And Methods | p. 268 |
Behavior-Related Methods | p. 270 |
Direct Descendents Of Component | p. 270 |
The Container Class | p. 271 |
How Container Classes Are Used | p. 271 |
Adding Components To A Container | p. 272 |
Using Checkbox Objects | p. 273 |
Using List And Choice Objects | p. 275 |
Getting Text Input | p. 277 |
Menu-Related Classes | p. 278 |
Building A Menu | p. 278 |
Graphics-Related Classes In The AWT | p. 281 |
The Color Class | p. 281 |
The ComponentOrientation Class | p. 281 |
The Cursor Class | p. 282 |
The AlphaComposite Class | p. 282 |
The Font Class | p. 283 |
The Graphics And Graphics2D Classes | p. 283 |
The Image Class And The java.awt.image Package | p. 283 |
Screen Geometry Classes | p. 284 |
Event-Related Classes In The AWT | p. 286 |
The Event Class | p. 286 |
The AWTEvent And EventObject Classes | p. 287 |
User Interfaces With Swing Classes | p. 287 |
The JComponent Class | p. 289 |
The ComponentUI Class | p. 289 |
Pluggable Look And Feel | p. 290 |
Primary Containers And JRootPane | p. 291 |
The JRootPane Class | p. 292 |
The JLayeredPane Class | p. 293 |
The JScrollPane Class | p. 294 |
Standard Dialog Boxes With JOptionPane | p. 294 |
A Summary Of User Controls With AWT And Swing | p. 295 |
Chapter Summary | p. 296 |
Review Questions | p. 296 |
Hands-On Projects | p. 299 |
Case Projects | p. 310 |
Bulding GUI Applications With Layout Managers | p. 311 |
The Layout Manager Concept | p. 312 |
The LayoutManager Interface | p. 312 |
Some Classes Implementing LayoutManager | p. 313 |
The LayoutManager2 Interface | p. 316 |
Building A Custom Layout Manager | p. 322 |
Default Layout Managers | p. 322 |
Specialized Containers | p. 322 |
Using The JToolBar Container | p. 323 |
Using The JTabbedPane Class | p. 324 |
The JSplitPane Class | p. 325 |
Chapter Summary | p. 325 |
Review Questions | p. 326 |
Hands-On Projects | p. 330 |
Case Projects | p. 340 |
Java Event Handling | p. 341 |
A Brief History Of Java Event Handling | p. 342 |
Events In Java 1.0 | p. 342 |
Events In Java 1.1 | p. 343 |
The Event Hierarchy | p. 344 |
The AWTEvent Class | p. 344 |
The ActionEvent Class | p. 345 |
The AdjustmentEvent Class | p. 346 |
The ComponentEvent Group | p. 347 |
The InputEvent Events | p. 348 |
The KeyEvent Class | p. 349 |
The MouseEvent Class | p. 349 |
Generating Events | p. 350 |
Event Listeners | p. 351 |
The Listener Interfaces | p. 351 |
The Adapter Classes | p. 351 |
Adding Listeners To A Component | p. 353 |
Listeners And Menus | p. 353 |
Listener Chains And The AWTEventMulticaster Class | p. 353 |
Coordinating Events With Actions | p. 354 |
The AbstractAction Class | p. 355 |
Creating Controls With An Action Object | p. 356 |
Chapter Summary | p. 356 |
Review Questions | p. 356 |
Hands-On Projects | p. 359 |
Case Projects | p. 375 |
Java Graphics | p. 377 |
Introduction To Graphics | p. 378 |
The Graphics Class | p. 378 |
Graphics Objects And Color | p. 378 |
Coordinate Systems And Graphics | p. 379 |
Drawing With Graphics | p. 379 |
Drawing In XOR Mode | p. 382 |
The Clipping Area | p. 382 |
Drawing Text | p. 384 |
The GraphicsEnvironment And Fonts | p. 384 |
The Font Class | p. 384 |
Positioning Text | p. 384 |
Where Do Graphics Come From? | p. 386 |
The Component getGraphics Method | p. 387 |
Graphics For Off-Screen Images | p. 387 |
The Graphics2D Class | p. 388 |
Graphics2D Coordinate Systems | p. 388 |
Graphics2D And Color | p. 389 |
Graphics2D And The Pen | p. 389 |
Printing | p. 389 |
The Printing Interfaces And Classes | p. 390 |
Working With Images | p. 392 |
The Image Class | p. 392 |
The MediaTracker Class | p. 393 |
Filters | p. 394 |
The PixelGrabber Class | p. 395 |
The MemoryImageSource Class | p. 395 |
Chapter Summary | p. 395 |
Review Questions | p. 396 |
Hands-On Projects | p. 397 |
Case Projects | p. 407 |
Java IO | p. 409 |
How Java Treats Files | p. 410 |
The File Class | p. 410 |
The RandomAccessFile Class | p. 413 |
Stream Methods | p. 414 |
Where Do Streams Come From? | p. 415 |
Streams And Network Connections | p. 415 |
Filtering Input Streams | p. 419 |
Plugging Functionality Together | p. 420 |
Readers And Writers | p. 421 |
The InputStreamReader Class | p. 421 |
The BufferedReader Class | p. 422 |
The FileReader Class | p. 422 |
The OutputStreamWriter Class | p. 422 |
The BufferedWriter Class | p. 422 |
The PrintWriter Class | p. 422 |
The FileWriter Class | p. 422 |
Object Serialization | p. 423 |
Writing An Object | p. 423 |
Reading An Object | p. 424 |
When And What To Serialize | p. 424 |
JAR And Zip Files | p. 425 |
Reading And Writing JAR FIles | p. 425 |
Networks, Sockets, TCP/IP, And Datagrams | p. 425 |
Networks And Protocols | p. 426 |
The Socket Class And TCP/IP | p. 426 |
The UDP Protocol And DatagramSockets | p. 427 |
Talking To Serial And Parallel Ports | p. 429 |
Chapter Summary | p. 429 |
Review Questions | p. 429 |
Hands-On Projects | p. 432 |
Case Projects | p. 452 |
Advanced Java Topics | p. 453 |
Java In A Demitasse | p. 454 |
Smart Card Standards | p. 454 |
Java Card Hardware | p. 454 |
The Java Card API | p. 455 |
The iButton Implementation OfJava Card | p. 456 |
The Java Communications API | p. 458 |
The Contents Of The javax.comm Package | p. 459 |
Managing Ports | p. 460 |
Talking To Ports With SerialPort And ParallelPort Objects | p. 460 |
Java Servlets | p. 462 |
The Basic Servlet Interface | p. 463 |
The Servlet Development Kit | p. 463 |
The servletrunner Utility | p. 464 |
Invoking A Servlet | p. 465 |
The Servlet API | p. 465 |
Life Cycle OfA Servlet | p. 468 |
Typical Servlet Uses | p. 468 |
Chapter Summary | p. 469 |
Hands-On Projects | p. 469 |
Case Projects | p. 477 |
Internet Resources And Books | p. 479 |
Java Programming And Debugging Hints | p. 483 |
Objectives | p. 487 |
Glossary | p. 489 |
Index | p. 513 |
Table of Contents provided by Syndetics. All Rights Reserved. |