did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780079137401

Java 2 Certification Exam Guide for Programmers and Developers

by ;
  • ISBN13:

    9780079137401

  • ISBN10:

    0079137407

  • Edition: 2nd
  • Format: Hardcover
  • Copyright: 1999-12-01
  • Publisher: McGraw-Hill Osborne Media
  • 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: $59.99

Summary

-- Both exams in one book -- Sun Microsystems, the creator of Java, has two Java Certification Exam -- one for programmers and one for developers. This Study Guide is the ultimate authority for both of the Java tests.
-- What's needed to pass the exam -- Fast and focused method for learning exactly what you need to pass both the Sun Certified Java 2 Programmer and Developer exams.
-- Complete Update -- This comprehensive exam guide for experienced Java programmers and developers has been fully revised, reviewed, and updated to cover every aspect of Java 2, the latest release. It includes exercises and hundreds of sample test questions.
-- Experienced/Qualified Author -- Barry Boone is a Sun Certified Java Programmer and Java Developer
-- CD-ROM -- JCertifiy test engine that includes hundreds of questions to help readers prepare for the exam.

Author Biography

Barry Boone, a Sun Certified Java Programmer and Developer, is President of Blue Horse Software, Inc.

Table of Contents

Introduction 1(1)
What This Book Is All About
2(1)
What Does It Mean to Become Sun Certified in Java
2(1)
Why Use ``Java Certification for Programmers and Developers'' to Prepare for the Exams
3(1)
Where Else Can You Go to Prepare for the Test
4(2)
What Should You Know Before You Start Studying
4(1)
Exercise 0.1
5(1)
What Is Barry's Background
6(1)
What Is William's Background
6(2)
How Is This Book Organized
8(2)
What Do You Do Once You're Ready to Take the Test
10(1)
Onward
10(1)
Answers to the Exercises
11(2)
Exercise 0-1
11(2)
Part I STUDYING FOR THE PROGRAMMER'S EXAM 13(396)
Taking the Programmer Exam
15(16)
What Is the Programmer Exam Like
16(1)
What's on the Exam
16(4)
Declarations and Access Control
17(1)
Flow Control and Exception Handling
17(1)
Garbage Collection
18(1)
Language Fundamentals
18(1)
Operators and Assignments
18(1)
Overloading, Overriding Runtime Type, and Object Orientation
19(1)
Threads
19(1)
The java.awt Package---Layout
20(1)
The java.lang Package
20(1)
The java.util Package
20(1)
How Does the Text Map to the Programmer's Exam Objectives
20(1)
How the Test Is Administered
21(1)
How to Sign Up and Take the Exams
21(2)
Test-Taking Tips for the Programmer Exam
23(5)
What the Test Looks Like
23(1)
Be Careful
24(1)
Take Your Time and Answer the Easy Ones First
24(1)
Beware of Tricks
25(1)
Understand Why the Question Is on the Test
26(1)
Know Your Test Center
27(1)
What Happens When You're Done
28(1)
Sun's Take on Certification
28(1)
How Sun Manages the Certification Process
29(1)
Where Certification Is Heading
30(1)
Java Programming Essentials
31(48)
Objectives for This Chapter
32(1)
Object-Oriented Relationship Using ``Is a'' and ``Has a''
33(3)
Exercise 2-1
35(1)
Exercise 2-2
36(1)
Review: Classes, Variables, and Methods
36(6)
Classes
36(1)
Member Variables
37(1)
Member Methods
37(1)
Packages
38(1)
Access Control
39(2)
Reuse Names
41(1)
Sharing Classes Between Applications
42(1)
Creating a Package
42(4)
Exercise 2-3
45(1)
Exercise 2-4
45(1)
Class Keywords
46(4)
public
46(1)
abstract
46(2)
final
48(1)
Exercise 2-5
49(1)
Exercise 2-6
50(1)
Ordering of a Java Source File
50(1)
Exercise 2-7
50(1)
Variable and Method Keywords
51(2)
static
51(1)
abstract
51(1)
final
51(1)
synchronized
52(1)
native
52(1)
transient
52(1)
volatile
53(1)
Exercise 2-8
53(1)
Access Control Keywords
53(1)
public
54(1)
private
54(1)
protected
54(1)
Exercises
54(5)
Exercise 2-9
54(1)
Exercise 2-10
55(1)
Exercise 2-11
55(1)
Exercise 2-12
56(1)
Exercise 2-13
56(1)
Exercise 2-14
57(1)
Exercise 2-15
57(2)
Exercise 2-16
59(1)
Casting Classes
59(2)
Interfaces
61(4)
How to Clone Objects
64(1)
Static Initializers
65(1)
Exercise 2-17
65(1)
Answers to the Exercises
66(9)
Exercise 2-1
66(1)
Exercise 2-2
67(1)
Exercise 2-3
68(1)
Exercise 2-4
69(1)
Exercise 2-5
69(1)
Exercise 2-6
69(1)
Exercise 2-7
70(1)
Exercise 2-8
70(1)
Exercise 2-9
70(1)
Exercise 2-10
70(1)
Exercise 2-11
71(1)
Exercise 2-12
71(1)
Exercise 2-13
71(1)
Exercise 2-14
72(1)
Exercise 2-15
72(1)
Exercise 2-16
73(1)
Exercise 2-17
73(1)
Exercise 2-18
74(1)
Exercise 2-19
74(1)
Review Questions
75(2)
Answers to the Review Questions
77(2)
Keywords and Constructors
79(24)
Objectives for This Chapter
80(1)
An Alphabetical List of the Keywords
81(1)
Organizing Classes
82(1)
Defining Classes
82(1)
Keywords for Classes and Members
83(2)
Simple Data Types
85(1)
Values and Variables
85(1)
Exception Handling
86(1)
Instance Creation and Testing
87(1)
Control Flow
88(2)
Exercises
90(1)
Exercise 3-1
90(1)
Exercise 3-2
91(1)
Exercise 3-3
91(1)
The Default Constructor
91(1)
Defining, Overloading, and Overriding a Constructor
92(2)
Invoking Another Constructor
94(2)
Exercise 3-4
94(1)
Exercise 3-5
95(1)
Exercise 3-6
95(1)
Answers to the Exercises
96(2)
Exercise 3-1
96(1)
Exercise 3-2
96(1)
Exercise 3-3
96(1)
Exercise 3-4
97(1)
Exercise 3-5
97(1)
Exercise 3-6
98(1)
Review Questions
98(3)
Answers to Review Questions
101(2)
Memory and Garbage Collection
103(20)
Objectives for This Chapter
104(1)
Garbage Collection
105(2)
When Does an Object Become Eligible for Garbage Collection
105(1)
Invoking the Garbage Collector
106(1)
Finalization
107(3)
Exercise 4-1
108(1)
Exercise 4-2
108(1)
Accessing Members
109(1)
Exercise 4-3
110(1)
Passing Parameters to a Method
110(5)
Exercise 4-4
115(1)
What's Not on the Test---Forcing Garbage Collection
115(1)
Answers to the Exercises
116(7)
Exercise 4-1
116(1)
Exercise 4-2
117(1)
Exercise 4-3
117(1)
Exercise 4-4
117(6)
Data Types and Values
123(16)
Objectives for this Chapter
124(1)
Data Types
124(5)
Default Values
125(1)
Literals and String Literals
126(1)
Character Values
126(1)
Floating-Point Arithmetic
127(1)
Casting
128(1)
Exercises
129(1)
Exercise 5-1
129(1)
Exercise 5-2
129(1)
Exercise 5-3
129(1)
Arrays
130(1)
Initializing an Array When It Is Allocated
131(4)
Exercise 5-4
132(1)
Arrays of Arrays
132(2)
Where Arrays Fit into the Class Hierarchy
134(1)
Answers to the Exercises
135(2)
Exercise 5-1
135(1)
Exercise 5-2
135(1)
Exercise 5-3
136(1)
Exercise 5-4
136(1)
Review Questions
137(1)
Answers to the Review Questions
138(1)
Operators
139(24)
Objectives for This Chapter
140(1)
Operators
141(4)
Arithmetic Operators
141(1)
Assignment Operators
142(1)
Comparison Operators
142(1)
Logical Operators
143(2)
Bitwise Operators
145(5)
The >> Operator
146(1)
The >>> Operator
147(1)
The << Operator
148(1)
The &, | and ^ Operators
149(1)
Exercises
150(1)
Exercise 6-1
150(1)
Testing for an Object's Class Type
151(1)
Exercise 6-2
152(1)
Equals() and ==
152(2)
Exercise 6-3
154(1)
Exercise 6-4
154(1)
Operator Precedence and Evaluation Order
154(2)
Answers to the Exercises
156(7)
Exercise 6-1
156(1)
Exercise 6-2
157(1)
Exercise 6-3
158(1)
Exercise 6-4
158(5)
Control Flow
163(16)
Objectives for This Chapter
164(1)
Nested Loops
164(2)
Labels
166(2)
Exercise 7-1
167(1)
Nested if and else Statements
168(1)
Legal Values for if Statements
169(1)
Exercise 7-2
169(1)
Switch and Case Statements
170(2)
While and Do-While Statements
172(1)
Using && and ||
172(2)
Exercise 7-3
173(1)
Answers to the Exercises
174(5)
Exercise 7-1
174(1)
Exercise 7-2
174(1)
Exercise 7-3
174(5)
Exceptions
179(26)
Objectives for This Chapter
180(1)
Exception Basics
180(7)
Working with Exceptions
181(4)
Exercise 8-1
185(1)
Common Java Exceptions
185(2)
Using Methods Defined by Exception and Throwable
187(1)
Rethrowing an Exception
187(2)
Exercise 8-2
188(1)
Which Exceptions a Method Can Throw
189(1)
Exceptions in an Overriding Method in a Subclass
190(2)
Exercise 8-3
191(1)
Creating and Throwing an Exception
192(1)
Exercise 8-4
192(1)
Answers to the Exercises
193(12)
Exercise 8-1
193(1)
Exercise 8-2
194(1)
Exercise 8-3
195(1)
Exercise 8-4
196(9)
Methods
205(16)
Objectives for This Chapter
206(1)
Defining a Method
206(1)
Overloading a Method
207(2)
Exercise 9-1
209(1)
Overriding a Method
209(4)
Access Control
210(1)
Other Keywords
211(1)
Return Types
211(1)
Parameter Types
211(1)
Exceptions
212(1)
Exercise 9-2
212(1)
Object References to Base and Derived Classes
213(2)
Declaring Native Methods
215(1)
Answers to the Exercises
216(1)
Exercise 9-1
216(1)
Exercise 9-2
216(1)
Review Questions
217(1)
Answer to the Review Questions
218(3)
Essential java.lang and java.util
221(32)
Objectives for This Chapter
222(1)
Wrapper Classes
222(5)
The Boolean Class
223(1)
The Character Class
224(1)
The byte, short, integer, and long Classes
224(1)
The float and double Classes
225(1)
Using Wrapper Classes
225(2)
Exercise 10-1
227(1)
Working with the Math Class
227(4)
abs()
227(1)
ceil()
227(1)
floor()
228(1)
max()
229(1)
min()
229(1)
random()
229(1)
round()
229(1)
sqrt()
230(1)
sin()
230(1)
cos()
231(1)
tan()
231(1)
Exercise 10-2
231(1)
The String and StringBuffer Classes
231(8)
String Operators
231(1)
The Immutability of Strings
232(2)
Methods of the String Class
234(3)
Exercise 10-3
237(1)
String Buffers
237(1)
Exercise 10-4
238(1)
Collections
239(5)
Overview of the Collections API
239(3)
Collection API Essentials
242(2)
Answers to the Exercises
244(9)
Exercise 10-1
244(1)
Exercise 10-2
245(1)
Exercise 10-3
245(1)
Exercise 10-4
245(8)
Input/Output
253(24)
Objectives for This Chapter
254(1)
The java.io Package
255(7)
InputStream and OutputStream
255(2)
FilterInputStream and FilterOutputStream
257(2)
DataInput and DataOuput
259(1)
Reader and Writer
260(2)
The File Class
262(6)
Testing to See if a File Exists
263(1)
Finding Information about a File Node
263(1)
Deleting and Renaming Files
263(1)
Creating Directories
263(1)
Navigating the File System
264(1)
Creating Files
264(1)
Exercise 11-1
265(1)
Creating Temporary Files
265(1)
Writing to and Reading from Files
266(2)
Exercise 11-2
268(1)
RandomAccessFiles
268(2)
File Descriptors
270(2)
Exercise 11-3
271(1)
Answers to the Exercises
272(1)
Exercise 11-1
272(1)
Exercise 11-2
272(1)
Exercise 11-3
273(1)
Review Questions
273(2)
Answers to the Review Questions
275(2)
Passing Arguments to Programs
277(20)
Objectives for This Chapter
278(1)
The main() Method
278(2)
Command-Line Arguments
280(2)
Exercise 12-1
281(1)
When main() Ends
282(1)
Embedding an Applet in an HTML Page
282(2)
Passing Parameters to an Applet
284(1)
Retrieving Parameters
285(2)
Exercise 12-2
287(1)
Customizing an Applet
287(4)
Answers to the Exercises
291(2)
Exercise 12-1
291(1)
Exercise 12-2
291(2)
Review Questions
293(1)
Answers to the Review Questions
294(3)
Threads
297(32)
Objectives for This Chapter
298(1)
An Overview of Threads
298(5)
Thread States
299(1)
Thread Life Cycles
300(2)
Thread Scheduling and Priorities
302(1)
Creating Threads with java.lang. Thread and java.lang.Runnable
303(5)
Subclassing Thread
303(2)
Implementing Runnable
305(2)
Exercise 13-1
307(1)
Monitors and Synchronization
308(12)
Understanding Synchronization
308(3)
Exercise 13-2
311(1)
Using wait(), notify(), and notifyAll()
312(5)
Exercise 13-3
317(1)
Managing Threads with Wait-Notify and Sleep
317(3)
Why a Thread Might Not Execute
320(1)
Exercise 13-4
321(1)
Other Useful Thread Methods
321(1)
Answers to the Exercises
321(8)
Exercise 13-1
321(2)
Exercise 13-2
323(1)
Exercise 13-3
323(1)
Exercise 13-4
323(6)
Graphics, Components, and Layout
329(44)
Objectives for This Chapter
330(1)
The Abstract Windowing Toolkit (AWT)
331(5)
Applets and AWT
331(1)
The paint() Method
332(1)
Repainting
333(1)
paint() and the Graphics Class
334(1)
Smoother Graphics
335(1)
Drawing Using a Graphics Object
336(8)
drawString()
337(1)
drawLine()
338(1)
drawRect() and fillRect()
338(3)
drawPolygon() and fillPolygon()
341(1)
drawArc() and fillArc()
341(2)
drawimage()
343(1)
Exercise 14-1
344(1)
The Image Class
344(1)
How Java Arranges Components within Containers
345(1)
The Component Class, Subclasses and Methods
346(6)
TextArea
346(2)
TextField
348(2)
List
350(1)
Exercise 14-2
350(2)
Key Component Methods
352(4)
setEnabled
352(1)
getSize/setSize
353(1)
setVisible
353(1)
setForeground/setBackground
354(1)
Components and Layout Managers
355(1)
Using Layout Managers
356(11)
FlowLayout
356(4)
BorderLayout
360(4)
GridLayout
364(2)
Other Types of Layout Managers
366(1)
Default Layout Managers
367(2)
Exercise 14-3
368(1)
Answers to the Exercises
369(3)
Exercise 14-1
369(1)
Exercise 14-2
369(1)
Exercise 14-3
369(3)
Answers to the Review Questions
372(1)
Events
373(24)
Objectives for This Chapter
374(1)
Event Classes
374(2)
Listening for Events
376(3)
The Listener Interfaces
379(4)
ActionListener
379(1)
AdjustmentListener
380(1)
ComponentListener
380(1)
ContainerListener
380(1)
FocusListener
381(1)
ItemListener
381(1)
KeyListener
381(1)
MouseListener
382(1)
MouseMotionListener
382(1)
TextListener
382(1)
WindowListener
383(1)
Implementing a Listener Interface
383(1)
Exercise 15-1
384(1)
Semantic and Low-Level Events
384(2)
AdjustmentEvent
385(1)
ItemEvent
386(1)
AWTEvent Subclasses
386(4)
AWTEvent
387(1)
ActionEvent
387(1)
AdjustmentEvent
387(1)
ComponentEvent
387(1)
ContainerEvent
388(1)
FocusEvent
388(1)
InputEvent
388(1)
ItemEvent
388(1)
KeyEvent
389(1)
MouseEvent
389(1)
PaintEvent
389(1)
TextEvent
389(1)
WindowEvent
390(1)
Exercise 15-2
390(1)
Extending Adapter Classes
390(2)
Exercise 15-3
392(1)
Answers to the Exercises
392(4)
Exercise 15-1
392(1)
Exercise 15-2
393(1)
Exercise 15-3
393(3)
Answers to the Review Questions
396(1)
Inner Classes
397(12)
Objectives for This Chapter
398(1)
Inner Classes
398(4)
Creating Inner Classes
398(4)
Anonymous Classes
402(1)
Static Inner Classes
402(2)
Exercise 16-1
403(1)
Answers to the Exercises
404(5)
Exercise 16-1
404(5)
Part II STUDYING FOR THE DEVELOPER'S EXAM 409(146)
The Developer Exam Roadmap
411(12)
A Quick Overview
412(1)
Concepts You Should Know Before Getting Started
413(1)
The Programming Assignment
414(3)
The Essay Exam
417(1)
How to Sign Up for and Take the Exams
418(2)
How to Acquire the Programming Assignment for the Developer Test
420(1)
Strategies for Approaching the Developer Assignment
421(2)
Developing With Java
423(32)
Objectives for This Chapter
424(1)
Styles and Conventions
425(1)
Identifiers
425(1)
Comments
426(1)
Error Handling
426(2)
Java's Documentation Problem
428(4)
javadoc
429(1)
Helping javadoc
429(3)
javadoc Tags
432(5)
Variables
432(3)
Classes
435(1)
Methods
436(1)
Rules for Using javadoc Comments and Tags
437(1)
Examples of javadoc Comments and Tags
438(2)
Abstract Classes
440(2)
Interfaces
442(1)
Grouping Behavior
442(1)
Enforcing Your API
442(1)
Identifying Intent
443(1)
Exercise 18-1
443(1)
Packages
443(3)
Creating Packages
443(1)
Restricting Access
444(1)
Defining Subsystems
445(1)
Exercise 18-2
446(1)
Defining Access Methods
446(4)
Exercise 18-3
449(1)
Answers to the Exercises
450(2)
Exercise 18-1
450(1)
Exercise 18-2
450(1)
Exercise 18-3
451(1)
Review Questions
452(1)
Answers to the Review Questions
453(2)
Accessing and Managing Databases
455(30)
Objectives for This Chapter
456(1)
Create Your Own Databases
457(3)
Accessing Databases from Multiple Clients
460(1)
Two-Tiered and Three-Tiered Architectures
461(1)
Using Java APIs
462(1)
Remote Method Invocation (RMI)
462(1)
Defining a Remote Interface
463(1)
Defining a Remote Class
464(5)
Defining the Class, Interface, and Constructor
465(2)
Installing the Security Manager and Registering the Bootstrap-Naming Service
467(2)
Invoking Remote Objects
469(4)
Stubs and Skeletons
471(1)
Getting Things Going
472(1)
Exercise 19-1
472(1)
Java Database Connectivity (JDBC)
473(4)
The Need for Drivers
473(1)
Using Open Database Connectivity (ODBC)
474(1)
Opening a Connection to a Database
475(1)
Interacting with a Database
476(1)
An Example of Using ODBC with Microsoft Access
477(3)
Exercise 19-2
479(1)
Answers to the Exercises
480(5)
Exercise 19-1
480(1)
Exercise 19-2
481(4)
Network Programming and Communication
485(48)
Objectives for This Chapter
486(1)
A TCP/IP Primer
486(3)
Ports and Sockets
489(1)
Streams
490(1)
Designing Servers and Clients
491(1)
Handling Multiple Clients
492(2)
Client Issues
494(1)
The Networking Package
495(4)
InetAddress
496(1)
Socket and ServerSocket
496(3)
Internet Streams
499(1)
Client-Server Examples
500(1)
Writing a Single-Client Server in Java
501(9)
server()
508(1)
client()
509(1)
action()
509(1)
run() for SingleChatReceive
510(1)
Cleaning Up
510(1)
Writing a Multi-Client Server in Java
510(11)
server()
516(1)
run()
516(1)
broadcast()
517(1)
cleanUp()
517(1)
The Client
517(3)
Cleaning Up
520(1)
Exercise 20-1
520(1)
Exercise 20-2
521(1)
Uniform Resource Locator (URL)
521(1)
Answer to the Exercises
522(9)
Exercise 20-1
522(4)
Exercise 20-2
526(5)
Answers to the Review Questions
531(2)
Designing Application Interfaces
533(22)
Objectives for This Chapter
534(1)
Mix and Match
535(8)
Using One Layout Manager
535(7)
Exercise 21-1
542(1)
Changing Your Look
543(3)
Text
544(1)
Font and Color
544(1)
Replacing a Component
545(1)
Exercise 21-2
546(1)
Working with Frames
546(2)
Closing the Frame
547(1)
Making an Applet a Stand-Alone Application
547(1)
Exercise 21-3
548(1)
Answers to the Exercises
548(5)
Exercise 21-1
548(2)
Exercise 21-2
550(2)
Exercise 21-3
552(1)
Answers to the Review Questions
553(2)
Part III PRACTICE EXAM 555(102)
Sun Certified Programmer Practice Exam
557(30)
Practice Exam Number 1
558(1)
Questions
558(24)
Answers to Exam Questions
582(5)
Sun Certified Programmer Practice Exam Number 2
587(26)
Questions
588(20)
Answers and Explanations
608(5)
Sun Certified Developer Practice Exam
613(38)
The Scenario
614(1)
The Prototype Specifications
615(1)
The Design Completed So Far
616(2)
The New Design
618(1)
The Code Completed So Far
619(6)
What You Will Add to the Code
625(2)
The Database
625(1)
The Server
626(1)
The Client
626(1)
The User Interface
627(1)
The Protocol
627(1)
Making a New Reservation
627(1)
Delete a Passenger's Reservation
627(1)
Finding a Passenger's Seat
628(1)
Finding All Open Seats
628(1)
Retrieving the List of Passengers
628(1)
What the user Interface Should Look Like When You're Done
628(4)
Updating the Passenger List
631(1)
Final Words of Advice
632(1)
One Possible Answer for the Client Side
633(9)
Client.java
633(3)
TopFrame.java
636(1)
EdnaUI.java
636(3)
NewPassenger.java
639(1)
DeletePassenger.java
640(2)
One Possible Answer for the Server Side
642(9)
Server.java (Including ClientServerThread)
642(6)
The Three Missing Methods from DB.java
648(3)
The Sun-Certified Developer Practice Essay Exam
651(6)
Part IV APPENDICES 657(8)
The CD-ROM
659(1)
How the CD-ROM is Organized
659(1)
Source Code
659(1)
Sun's JDK
660(1)
Web Links
660(1)
What Is JCertify
660(1)
The Java Development Kit (JDK)
661(1)
The Pieces of the JDK
661(4)
The Compiler
662(1)
The Runtime environment for Standalone Programs
663(1)
appletviewer
663(2)
Index 665

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