rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780672326288

Sams Teach Yourself Java 2 in 21 Days

by ;
  • ISBN13:

    9780672326288

  • ISBN10:

    0672326280

  • Edition: 4th
  • Format: Paperback w/CD
  • Copyright: 2004-01-01
  • Publisher: Sams
  • View Upgraded Edition

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.99 Save up to $10.00
  • Buy Used
    $29.99

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

Summary

In just 21 days, you can acquire the knowledge and skills necessary to develop three kinds of programs with Java: applications on your computer, servlets on a Web server, and applets on the Web.

Author Biography

Rogers Cadenhead is a Web application developer who has written 17 books on Internet-related topics Laura Lemay is one of the world's most popular authors on Web development topics

Table of Contents

Introduction 1(6)
Week 1 The Java Language
7(208)
Getting Started with Java
9(26)
The Java Language
10(3)
History of the Language
10(1)
Introduction to Java
11(1)
Selecting a Development Tool
12(1)
Object-Oriented Programming
13(2)
Objects and Classes
15(2)
Object Reuse
16(1)
Attributes and Behavior
17(7)
Attributes of a Class of Objects
18(1)
Behavior of a Class of Objects
19(1)
Creating a Class
19(2)
Running the Program
21(3)
Organizing Classes and Class Behavior
24(7)
Inheritance
24(2)
Creating a Class Hierarchy
26(2)
Inheritance in Action
28(1)
Single and Multiple Inheritance
29(1)
Interfaces
30(1)
Packages
31(1)
Summary
31(2)
Q&A
33(1)
Quiz
33(1)
Questions
33(1)
Answers
34(1)
Certification Practice
34(1)
Exercises
34(1)
The ABCs of Programming
35(28)
Statements and Expressions
36(1)
Variables and Data Types
37(7)
Creating Variables
38(1)
Naming Variables
39(1)
Variable Types
40(2)
Assigning Values to Variables
42(1)
Constants
42(2)
Comments
44(1)
Literals
45(3)
Number Literals
45(1)
Boolean Literals
46(1)
Character Literals
47(1)
String Literals
47(1)
Expressions and Operators
48(9)
Arithmetic
49(2)
More About Assignment
51(1)
Incrementing and Decrementing
52(1)
Comparisons
53(1)
Logical Operators
54(1)
Operator Precedence
55(2)
String Arithmetic
57(1)
Summary
58(1)
Q&A
59(1)
Quiz
60(1)
Questions
60(1)
Answers
60(1)
Certification Practice
61(1)
Exercises
61(2)
Working with Objects
63(24)
Creating New Objects
63(4)
Using new
64(2)
What new Does
66(1)
A Note on Memory Management
66(1)
Accessing and Setting Class and Instance Variables
67(3)
Getting Values
67(1)
Changing Values
68(1)
Class Variables
69(1)
Calling Methods
70(3)
Nesting Method Calls
71(1)
Class Methods
72(1)
References to Objects
73(2)
Casting and Converting Objects and Primitive Types
75(5)
Casting Primitive Types
76(1)
Casting Objects
77(1)
Converting Primitive Types to Objects and Vice Versa
78(2)
Comparing Object Values and Classes
80(3)
Comparing Objects
81(1)
Determining the Class of an Object
82(1)
Summary
83(1)
Q&A
83(1)
Quiz
84(2)
Questions
84(1)
Answers
85(1)
Certification Practice
85(1)
Exercises
86(1)
Lists, Logic, and Loops
87(26)
Arrays
87(7)
Declaring Array Variables
88(1)
Creating Array Objects
89(1)
Accessing Array Elements
90(1)
Changing Array Elements
91(2)
Multidimensional Arrays
93(1)
Block Statements
94(1)
if Conditionals
95(2)
switch Conditionals
97(5)
for Loops
102(3)
while and do Loops
105(2)
while Loops
105(2)
do-while Loops
107(1)
Breaking Out of Loops
107(3)
Labeled Loops
108(1)
The Conditional Operator
109(1)
Summary
110(1)
Q&A
110(1)
Quiz
111(1)
Questions
111(1)
Answers
111(1)
Certification Practice
111(1)
Exercises
112(1)
Creating Classes and Methods
113(30)
Defining Classes
114(1)
Creating Instance and Class Variables
114(2)
Defining Instance Variables
114(1)
Class Variables
115(1)
Creating Methods
116(6)
Defining Methods
116(2)
The this Keyword
118(1)
Variable Scope and Method Definitions
119(1)
Passing Arguments to Methods
120(1)
Class Methods
121(1)
Creating Java Applications
122(2)
Helper Classes
123(1)
Java Applications and Command-Line Arguments
124(2)
Passing Arguments to Java Applications
124(1)
Handling Arguments in Your Java Application
125(1)
Creating Methods with the Same Name, Different Arguments
126(4)
Constructor Methods
130(4)
Basic Constructor Methods
131(1)
Calling Another Constructor Method
131(1)
Overloading Constructor Methods
132(2)
Overriding Methods
134(4)
Creating Methods That Override Existing Methods
134(1)
Calling the Original Method
135(1)
Overriding Constructors
136(2)
Finalizer Methods
138(1)
Summary
139(1)
Q&A
139(1)
Quiz
140(2)
Questions
140(1)
Answers
141(1)
Certification Practice
141(1)
Exercises
142(1)
Packages, Interfaces, and Other Class Features
143(38)
Modifiers
144(6)
Access Control for Methods and Variables
145(5)
Static Variables and Methods
150(2)
Final Classes, Methods, and Variables
152(2)
Variables
153(1)
Methods
153(1)
Classes
154(1)
Abstract Classes and Methods
154(1)
Packages
155(1)
Using Packages
156(4)
Full Package and Class Names
156(1)
The import Declaration
157(2)
Class Name Conflicts
159(1)
A Note About Classpath and Where Classes Are Located
159(1)
Creating Your Own Packages
160(2)
Picking a Package Name
160(1)
Creating the Folder Structure
161(1)
Adding a Class to a Package
161(1)
Packages and Class Access Control
161(1)
Interfaces
162(3)
The Problem of Single Inheritance
162(1)
Interfaces and Classes
163(1)
Implementing and Using Interfaces
163(1)
Implementing Multiple Interfaces
164(1)
Other Uses of Interfaces
164(1)
Creating and Extending Interfaces
165(8)
New Interfaces
165(1)
Methods Inside Interfaces
166(1)
Extending Interfaces
166(1)
Creating an Online Storefront
167(6)
Inner Classes
173(3)
Summary
176(1)
Q&A
176(1)
Quiz
177(2)
Questions
177(1)
Answers
177(1)
Certification Practice
178(1)
Exercises
179(2)
Threads, Exceptions, and Assertions
181(34)
Exceptions
182(3)
Exception Classes
184(1)
Managing Exceptions
185(5)
Exception Consistency Checking
185(1)
Protecting Code and Catching Exceptions
186(2)
The finally Clause
188(2)
Declaring Methods That Might Throw Exceptions
190(4)
The throws Clause
191(1)
Which Exceptions Should You Throw?
192(1)
Passing On Exceptions
192(2)
throws and Inheritance
194(1)
Creating and Throwing Your Own Exceptions
194(3)
Throwing Exceptions
195(1)
Creating Your Own Exceptions
195(1)
Combining throws, try, and throw
196(1)
When and When Not to Use Exceptions
197(2)
When to Use Exceptions
197(1)
When Not to Use Exceptions
197(1)
Bad Style Using Exceptions
198(1)
Assertions
199(3)
Threads
202(7)
Writing a Threaded Program
202(2)
A Threaded Application
204(4)
Stopping a Thread
208(1)
Summary
209(1)
Q&A
210(1)
Quiz
211(1)
Questions
211(1)
Answers
211(1)
Certification Practice
212(1)
Exercises
212(3)
Week 2 The Java Class Library
215(196)
Data Structures
217(28)
Data Structures
217(1)
Java Data Structures
218(20)
Iterator
219(2)
Bit Sets
221(3)
Vectors
224(3)
Looping Through Data Structures
227(3)
Stacks
230(1)
Map
231(2)
Hashtables
233(5)
Generics
238(3)
Summary
241(1)
Q&A
241(1)
Quiz
242(2)
Questions
242(1)
Answers
242(1)
Certification Practice
243(1)
Exercises
244(1)
Working with Swing
245(26)
Creating an Application
246(7)
Creating an Interface
247(2)
Developing a Framework
249(2)
Creating a Component
251(1)
Adding Components to a Container
252(1)
Working with Components
253(12)
Image Icons
254(2)
Labels
256(1)
Text Fields
257(1)
Text Areas
258(1)
Scrolling Panes
259(2)
Check Boxes and Radio Buttons
261(2)
Combo Boxes
263(2)
Lists
265(1)
Summary
266(1)
Q&A
267(1)
Quiz
268(2)
Questions
268(1)
Answers
269(1)
Certification Practice
269(1)
Exercises
270(1)
Building a Swing Interface
271(28)
Swing Features
272(23)
Setting the Look and Feel
272(3)
Standard Dialog Boxes
275(4)
Using Dialog Boxes
279(3)
Sliders
282(2)
Scroll Panes
284(1)
Toolbars
285(3)
Progress Bars
288(2)
Menus
290(4)
Tabbed Panes
294(1)
Summary
295(1)
Q&A
295(1)
Quiz
296(2)
Questions
296(1)
Answers
297(1)
Certification Practice
297(1)
Exercises
298(1)
Arranging Components on a User Interface
299(30)
Basic Interface Layout
300(8)
Laying Out an Interface
300(1)
Flow Layout
301(2)
Box Layout
303(2)
Grid Layout
305(2)
Border Layout
307(1)
Mixing Layout Managers
308(1)
Card Layout
309(7)
Using Card Layout in an Application
311(5)
Grid Bag Layout
316(9)
Designing the Grid
319(1)
Creating the Grid
320(4)
Cell Padding and Insets
324(1)
Summary
325(1)
Q&A
325(1)
Quiz
326(2)
Questions
326(1)
Answers
327(1)
Certification Practice
327(1)
Exercises
328(1)
Responding to User Input
329(22)
Event Listeners
329(5)
Setting Up Components
330(1)
Event-Handling Methods
331(3)
Working with Methods
334(13)
Action Events
334(1)
Focus Events
335(3)
Item Events
338(1)
Key Events
339(1)
Mouse Events
340(1)
Mouse Motion Events
341(4)
Window Events
345(1)
Using Adapter Classes
346(1)
Summary
347(1)
Q&A
347(1)
Quiz
348(2)
Questions
348(1)
Answers
349(1)
Certification Practice
349(1)
Exercises
350(1)
Using Color, Fonts, and Graphics
351(24)
The Graphics2D Class
351(3)
The Graphics Coordinate System
353(1)
Drawing Text
354(5)
Improving Fonts and Graphics with Antialiasing
356(1)
Finding Information About a Font
356(3)
Color
359(2)
Using Color Objects
359(1)
Testing and Setting the Current Colors
360(1)
Drawing Lines and Polygons
361(10)
User and Device Coordinate Spaces
362(1)
Specifying the Rendering Attributes
362(3)
Creating Objects to Draw
365(3)
Drawing Objects
368(3)
Summary
371(1)
Q&A
372(1)
Quiz
372(2)
Questions
372(1)
Answers
373(1)
Certification Practice
373(1)
Exercises
374(1)
Writing Java Applets and Java Web Start Applications
375(36)
How Applets and Applications Are Different
376(1)
Applet Security Restrictions
376(2)
Choosing a Java Version
377(1)
Creating Applets
378(5)
Applet Methods
378(3)
Writing an Applet
381(2)
Including an Applet on a Web Page
383(4)
The APPLET Tag
383(2)
Loading an Applet
385(2)
Putting Applets on the Web
387(1)
Java Archives
387(1)
Passing Parameters to Applets
388(3)
Sun's HTML Converter
391(1)
Java Web Start
392(4)
Using Java Web Start
396(10)
Creating a JNLP File
396(5)
Supporting Web Start on a Server
401(1)
Additional JNLP Elements
402(2)
Running Applets
404(2)
Summary
406(1)
Q&A
406(1)
Quiz
407(2)
Questions
407(1)
Answers
408(1)
Certification Practice
408(1)
Exercises
409(2)
Week 3 Java Programming
411(218)
Working with Input and Output
413(28)
Introduction to Streams
414(2)
Using a Stream
414(1)
Filtering a Stream
415(1)
Handling Exceptions
416(1)
Byte Streams
416(5)
File Streams
416(5)
Filtering a Stream
421(9)
Byte Filters
421(9)
Character Streams
430(4)
Reading Text Files
430(3)
Writing Text Files
433(1)
Files and Filename Filters
434(3)
Summary
437(1)
Q&A
437(1)
Quiz
438(2)
Questions
438(1)
Answers
439(1)
Certification Practice
439(1)
Exercises
440(1)
Serializing and Examining Objects
441(28)
Object Serialization
442(9)
Object Output Streams
443(3)
Object Input Streams
446(3)
Transient Variables
449(1)
Checking an Object's Serialized Fields
450(1)
Inspecting Classes and Methods with Reflection
451(6)
Inspecting and Creating Classes
451(2)
Working with Each Part of a Class
453(1)
Inspecting a Class
454(3)
Remote Method Invocation
457(9)
RMI Architecture
457(2)
Creating RMI Applications
459(7)
Summary
466(1)
Q&A
466(1)
Quiz
467(1)
Questions
467(1)
Answers
467(1)
Certification Practice
468(1)
Exercises
468(1)
Communicating Across the Internet
469(32)
Networking in Java
470(12)
Opening a Stream over the Net
470(5)
Sockets
475(4)
Socket Servers
479(2)
Testing the Server
481(1)
The java.nio Package
482(14)
Buffers
483(4)
Channels
487(9)
Summary
496(1)
Q&A
496(1)
Quiz
497(2)
Questions
497(1)
Answers
498(1)
Certification Practice
498(1)
Exercises
499(2)
JavaSound
501(20)
JavaSound
501(16)
MIDI Files
502(1)
Playing a MIDI File
503(5)
Sampled Audio Files
508(3)
Manipulating Sound Files
511(6)
Summary
517(1)
Q&A
518(1)
Quiz
518(2)
Questions
518(1)
Answers
519(1)
Certification Practice
519(1)
Exercises
520(1)
Creating and Using JavaBeans
521(22)
Reusable Software Components
522(7)
Developing JavaBeans
523(3)
Creating a Bean
526(3)
Development Tools
529(2)
JavaBeans Development Kit
530(1)
Working with JavaBeans
531(9)
Bean Containers
532(1)
Placing a Bean
533(1)
Adjusting a Bean's Properties
534(2)
Creating Interactions Among Beans
536(2)
Creating a JavaBeans Program
538(1)
Working with Other Beans
539(1)
Summary
540(1)
Q&A
540(1)
Quiz
541(1)
Questions
541(1)
Answers
541(1)
Certification Practice
541(1)
Exercises
542(1)
Reading and Writing Data Using JDBC and XML
543(42)
Java Database Connectivity
544(19)
Database Drivers
545(1)
The JDBC-ODBC Bridge
546(1)
Connecting to an ODBC Data Source
547(13)
JDBC Drivers
560(3)
Using XML
563(5)
Designing an XML Dialect
566(2)
Processing XML with Java
568(1)
Processing XML with XOM
568(14)
Creating an XML Document
570(3)
Modifying an XML Document
573(4)
Formatting an XML Document
577(2)
Evaluating XOM
579(3)
Summary
582(1)
Q&A
582(1)
Quiz
583(1)
Questions
583(1)
Answers
583(1)
Certification Practice
584(1)
Exercises
584(1)
Writing Java Servlets and JavaServer Pages
585(44)
Using Servlets
586(3)
Supporting Servlets
587(2)
Developing Servlets
589(13)
Using Cookies
595(4)
Using Sessions
599(3)
JavaServer Pages
602(15)
Writing a JavaServer Page
604(7)
Creating a Web Application
611(6)
JSP Standard Tag Library
617(8)
Summary
625(1)
Q&A
625(1)
Quiz
626(2)
Questions
626(1)
Answers
627(1)
Certification Practice
627(1)
Exercises
628(1)
Appendixes
629(2)
Appendix A Choosing Java
631(12)
Java's Past, Present, and Future
632(5)
Interactive Web Programming
632(2)
Java Grew from a Little Oak
634(1)
Versions of the Language
635(2)
Java's Outlook
637(1)
Why Choose Java
637(4)
Java Is Object-Oriented
638(1)
Java Is Easy to Learn
638(1)
Java Is Platform Neutral
639(2)
Summary
641(2)
Appendix B Using the Java 2 Software Development Kit
643(24)
Choosing a Java Development Tool
644(4)
Installing the Software Development Kit
645(3)
Configuring the Software Development Kit
648(9)
Using a Command-Line Interface
649(1)
Opening Folders in MS-DOS
650(1)
Creating Folders in MS-DOS
651(1)
Running Programs in MS-DOS
652(1)
Correcting Configuration Errors
653(4)
Using a Text Editor
657(1)
Creating a Sample Program
658(4)
Compiling and Running the Program in Windows
660(2)
Setting Up the CLASSPATH Variable
662(5)
Setting the CLASSPATH on Windows 98 or ME
662(2)
Setting the Classpath on Windows NT, XP, 2000, or 2003
664(2)
Troubleshooting Your Kit Installation
666(1)
Appendix C Programming with the Java 2 Software Development Kit
667(22)
An Overview of the SDK
668(1)
The java Interpreter
669(2)
The javac Compiler
671(2)
The appletviewer Browser
673(3)
The javadoc Documentation Tool
676(4)
The jar Java File Archival Tool
680(2)
The jdb Debugger
682(4)
Debugging Applications
683(2)
Debugging Applets
685(1)
Advanced Debugging Commands
685(1)
Using System Properties
686(2)
Summary
688(1)
Appendix D Using the NetBeans Integrated Development Environment
689(10)
Choosing a Java Development Tool
690(2)
Installing NetBeans
690(2)
Creating a Sample Program
692(7)
Compiling and Running the Program
697(2)
Appendix E Writing Java 1.1 Applets
699(22)
Java 1.1 Programming
700(19)
Creating an Applet
700(3)
Drawing Inside an Applet
703(4)
Creating a Graphical User Interface
707(7)
Handling User Events
714(5)
Summary
719(2)
Appendix F Creating Web Services with XML-RPC
721(18)
Introduction to XML-RPC
722(2)
Communicating with XML-RPC
724(3)
Sending a Request
724(2)
Responding to a Request
726(1)
Choosing an XML-RPC Implementation
727(2)
Using an XML-RPC Web Service
729(3)
Creating an XML-RPC Web Service
732(5)
Summary
737(2)
Appendix G Regular Expressions
739(14)
Introduction to Pattern Matching
740(2)
The CharSequence Interface
741(1)
Using Regular Expressions
742(4)
Looking for a Match
742(3)
Splitting Strings with Patterns
745(1)
Patterns
746(5)
Matches
748(3)
Summary
751(2)
Appendix H Where to Go from Here: Java Resources
753(6)
Other Books to Consider
753(1)
Sun's Official Java Site
754(1)
Java 2 Version 1.5 Class Documentation
755(1)
Other Java Web Sites
755(1)
This Book's Official Site
755(1)
Cafe au Lait
755(1)
Workbench
755(1)
InformIT
755(1)
Java Review Service
756(1)
JavaWorld Magazine
756(1)
Gamelan: Earthweb's Java Directory
756(1)
Java Newsgroups
756(2)
Job Opportunities
758(1)
Appendix I This Book's Web Site
759(2)
Index 761

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program