Java

by
Edition: 2nd
Format: Paperback
Pub. Date: 2001-07-26
Publisher(s): Cengage Learning
List Price: $152.95

Rent Textbook

Select for Price
There was a problem. Please try again later.

New Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Lambert and Osborne's content appeals to readers who want to cover traditional CS1 material using the powerful capabilities Java provides. Chapter One starts out strong by introducing readers to the topic of problem-solving. Object-oriented design and Java features are introduced as needed. Those who teach CS1 in Java face a dilemma: either restrict the course to character-based terminal I/O with a C++ look, or introduce graphical user interfaces (GUIs) and overwhelm readers with the details of Java's Abstract Windowing Toolkit (AWT). To overcome this dilemma, the book comes with a software package, BreezySwing, which simplifies the programming of GUIs. BreezySwing insulates readers from the complex details of laying out window components and responding to interface events. Lambert and Osborne's book and software package enable readers to enjoy the excitement of writing GUI-based programs without being overwhelmed by or distracted from the more basic issues of algorithm design. The University Edition of Borland's JBuilder 4 is packaged with the book.

Table of Contents

Background
1(23)
History of Computers
1(2)
Computer Hardware and Software
3(4)
Bits and Bytes
3(1)
Computer Hardware
3(3)
Computer Software
6(1)
Binary Representation of Information and Computer Memory
7(6)
Integers
7(1)
Floating-Point Numbers
8(1)
Characters and Strings
9(1)
Images
10(1)
Sound
10(1)
Program Instructions
11(1)
Computer Memory
11(2)
Programming Languages
13(2)
Software Development Process
15(3)
Basic Concepts of Object-Oriented Programming
18(4)
Summary
22(1)
Key Terms
22(1)
Answers to Self-Test Questions
22(2)
First Java
24(20)
Why Java?
24(1)
The Java Virtual Machine and Byte Code
25(1)
Choosing an Interface Style
26(1)
Hello World
27(3)
The Source Code
27(1)
The Explanation
28(1)
The ScreenWriter Class
28(1)
The Larger Framework
29(1)
Edit, Compile, and Execute
30(7)
Development Environments
31(1)
Step-by-Step Instructions
32(2)
Compile-Time Errors
34(2)
Readability
36(1)
Temperature Conversion
37(4)
The Source Code
37(1)
The Explanation
38(2)
Variables and Objects
40(1)
Summary
41(1)
Key Terms
42(1)
Answers to Self-Test Questions
42(1)
Programming Problems and Activities
43(1)
Syntax, Errors, and Debugging
44(30)
Language Elements
44(2)
Vocabulary
44(1)
Syntax
45(1)
Semantics
45(1)
Programming and Natural Languages
45(1)
Basic Java Syntax and Semantics
46(7)
Literals
46(1)
Numeric Data Types
46(1)
Variables
46(1)
Variable Declarations and Object Instantiation
47(1)
Assignment Statements
48(1)
Arithmetic Expressions
48(2)
Mixed-Mode Arithmetic
50(1)
User-Defined Symbols
51(2)
Case Study: Income Tax Calculator
53(3)
Programming Errors
56(6)
The Three Types of Errors
56(1)
Illustration of Syntax Errors
57(1)
Illustration of Run-Time Errors
58(3)
Illustration of Logic Errors
61(1)
Debugging
62(2)
Comments
64(1)
Case Study: Count the Angels
65(3)
The Lines in Blue
68(3)
The import Statement
68(1)
The Program Class and Program Object
69(1)
Instantiating and Running the Program Object
69(1)
The Method main
70(1)
Summary
71(1)
Key Terms
71(1)
Answers to Self-Test Questions
71(1)
Programming Problems and Activities
72(2)
Control Statements
74(34)
A Visit to the Farm
74(2)
The if and if-else Statements
76(2)
Examples
77(1)
Relational and Logical Operators
78(4)
Case Study: Compute Weekly Pay
82(2)
Testing
84(2)
The while Statement
86(6)
Three Short Examples
86(2)
A Common Loop Structure
88(1)
Logic Errors in Loops, Including Infinite Loops
88(3)
Debugging Loops
91(1)
Case Study: Count the Divisors
92(1)
More Testing
93(2)
Case Study: Fibonacci Numbers
95(4)
Loop Analysis
97(1)
Test Data
98(1)
Nested if Statements
99(3)
Design, Testing, and Debugging Hints
102(1)
Summary
103(1)
Key Terms
103(1)
Answers to Self-Test Questions
104(1)
Programming Problems and Activities
105(3)
Improving the User Interface
108(19)
Repeating Sets of Inputs
108(2)
Strings
110(2)
String Literals
110(1)
String Variables and String Concatenation
110(1)
Adding Newline Characters to Strings
111(1)
Reading Strings
112(1)
A Menu-Driven Conversion Program
112(3)
A GUI-Based Conversion Program
115(2)
The GUI Program Explained
117(3)
Other Window Objects and Methods
120(4)
Integer Field Objects
121(1)
Text Field Objects
121(1)
Text Area Objects
121(1)
Declaring Window Objects
122(1)
The messageBox Method
122(1)
Setting the Look and Feel
123(1)
Summary
124(1)
Key Terms
124(1)
Answers to Self-Test Questions
124(1)
Programming Problems and Activities
125(2)
Cooperating Methods
127(36)
First Look at Cooperating Methods
127(4)
The Complete Program without Decomposition
128(1)
Decomposed Version of the buttonClicked Method
128(1)
Analysis of the Running Program
129(1)
Basic Terminology
130(1)
How Methods Share Information
131(6)
Accessing a Common Pool of Variables
131(1)
Parameters and Return Values
131(5)
Sharing Variables versus Passing Parameters
136(1)
Scope and Lifetime of Variables
137(3)
Scope of Variables
137(1)
Lifetime of Variables
138(1)
Duplicating Variable Names
138(2)
Preconditions and Postconditions
140(1)
Overloaded Methods
141(1)
Cohesion and Coupling
141(2)
Case Study: Tally Grades
143(3)
Implementation and Testing Strategies
146(12)
Top-Down Implementation and Testing Strategy
146(7)
Finding the Location of Run-Time Errors
153(1)
Expanding Capabilities Implementation and Testing Strategy (Optional)
154(2)
Bottom-Up Implementation and Testing Strategy (Optional)
156(2)
Mixed Implementation and Testing Strategy (Optional)
158(1)
Summary
158(1)
Design, Testing, and Debugging Hints
159(1)
Key Terms
159(1)
Answers to Self-Test Questions
160(1)
Programming Problems and Activities
161(2)
More Data Types, Operators, and Control Statements
163(32)
Data Types
163(5)
Booleans
163(1)
Characters
164(3)
Other Numeric Data Types
167(1)
Symbolic Constants and the Final Qualifier
168(1)
The Cast Operator and Mixed-Mode Arithmetic
169(1)
Arithmetic and Assignment Operators
170(3)
Increment and Decrement Operators
171(1)
Extended Assignment Operators
171(2)
The Math Class
173(2)
Two Sample Programs
175(2)
Using the Cast Operator and Symbolic Constants
175(1)
Using the random Method
176(1)
Control Statements
177(6)
do-while Statement
177(1)
for Statement
178(2)
switch Statement
180(1)
break Statement
181(1)
continue Statement
182(1)
Strings Revisited
183(4)
String Methods
183(1)
Conversion between Strings and Primitive Data Types
183(3)
Short Examples of String Manipulations
186(1)
Case Study: Palindromes
187(3)
Design, Testing, and Debugging Hints
190(1)
Summary
191(1)
Key Terms
191(1)
Answers to Self-Test Questions
191(2)
Programming Problems and Activities
193(2)
In Greater Depth
195(28)
Peculiarities of Computer Arithmetic
195(3)
Nested if Statements Revisited
198(5)
Logical Errors: Calculating a Salesperson's Commission
199(2)
Rewriting Nested if Statements
201(1)
Rewriting Complex Conditions
201(2)
Loop Invariants
203(7)
Computing the gcd of Two Numbers
204(1)
Balzano Bisection
205(2)
Summing a Series
207(3)
String Utilities
210(3)
The StringBuffer Class
210(2)
The StringTokenizer Class
212(1)
Formatted Output
213(3)
Case Study: A Sales Table
216(4)
Design, Testing, and Debugging Hints
220(1)
Summary
220(1)
Key Terms
220(1)
Answers to Self-Test Questions
221(1)
Programming Problems and Activities
222(1)
Cooperating Classes
223(38)
Classes and Objects
223(2)
Three Characteristics of an Object
224(1)
Clients and Servers
224(1)
A Student Class
225(8)
Using Student Objects
225(3)
Structure of a Class Template
228(3)
Implementation of the Student Class
231(2)
Editing, Compiling, and Testing the Student Class
233(3)
Finding the Location of Run-Time Errors
235(1)
BreezySwing: Titles and Menus
236(1)
Menus
236(1)
The setTitle Method
237(1)
Case Study: Student Test Scores
237(6)
Request
237(1)
Analysis
237(2)
Design
239(3)
Implementation
242(1)
The Static Modifier
243(6)
Counting the Number of Students Instantiated
243(1)
Modifying the Student Class
244(1)
Class Constants
245(1)
Rules for Using the Static Modifier
246(1)
The Math Class Revisited
246(1)
The static Method main
246(1)
Writing Programs That Use Only Static Methods
247(1)
Restriction on the Use of the messageBox Method
248(1)
Constructors
249(1)
Primitive Types, Reference Types, and the null Value
250(2)
Copying Objects
252(1)
Comparing Objects for Equality
253(1)
The Methods finalize and dispose
254(1)
Design, Testing, and Debugging Hints
255(1)
Summary
256(1)
Key Terms
256(1)
Answers to Self-Test Questions
257(1)
Programming Problems and Activities
258(3)
Arrays, Searching, and Sorting
261(46)
Conceptual Overview
261(2)
Simple Array Manipulations
263(1)
Looping Through Arrays
264(7)
Sum the Elements
265(1)
Count the Occurrences
265(1)
Determine Presence or Absence
265(1)
Determine First Location
266(1)
Locate Largest Number
266(1)
Move Smallest Number to First Position
267(1)
Move Second Smallest Number to Second Position
268(1)
Sort in Ascending Order
268(1)
Sort in Descending Order
269(1)
Insert an Element
269(1)
Delete an Element
270(1)
Declaring Arrays
271(3)
Parallel Arrays
274(1)
Two-Dimensional Arrays
275(4)
Definition
275(1)
Sum the Elements
276(1)
Sum the Rows
276(1)
Locate Largest Number
277(1)
Declare and Instantiate
277(1)
Variable Length Rows
278(1)
Three-Dimensional Arrays and Higher
279(1)
Arrays and Methods
280(4)
Sum the Elements
280(1)
Search for a Value
281(1)
Sort in Ascending Order
281(1)
Sum the Rows
282(1)
Copy an Array
282(1)
Other Objects and Methods
283(1)
The Mysterious Parameter in Method main
283(1)
Case Study: Student Test Scores Again
284(8)
The Model/View Pattern
292(8)
Design, Testing, and Debugging Hints
300(1)
Summary
301(1)
Key Terms
301(1)
Answers to Self-Test Questions
301(2)
Programming Problems and Activities
303(4)
Inheritance, Abstract Classes, and Polymorphism
307(39)
Implementing a Simple Shape Hierarchy
308(7)
Implementing the Shape Class
308(2)
Implementing the Circle Class
310(1)
Constructors and super
311(1)
Other Methods and super
312(1)
Implementing the Rect Class
312(1)
Protected Variables and Methods
313(1)
Implementation, Extension, Overriding, and Finality
314(1)
Using the Shape Classes
315(1)
Finding the Right Method
316(1)
Extending the Shape Hierarchy
316(3)
Implementing the Cylinder Class
317(1)
More About the Use of super
318(1)
Testing the Cylinder Class
319(1)
Arrays of Shapes
319(4)
Declaring an Array of Shapes
319(2)
Sending Messages to Objects in an Array of Shapes
321(2)
Shapes as Parameters and Return Values
323(3)
Rectangle In, Circle Out
323(1)
Any Shape In, Circle Out
324(1)
Any Shape In, Any Shape Out
324(2)
An Employee Hierarchy
326(2)
BreezySwing: Check Boxes and Radio Buttons
328(4)
Check Boxes
330(1)
Radio Buttons
331(1)
Case Study: The Painter's Friend
332(10)
Object-Oriented Analysis and Design Guidelines
342(2)
Objects: A Universal Means of Representation
342(1)
Analyzing Objects
342(1)
Designing Objects
342(1)
Maximizing Information Hiding
343(1)
Maximizing Inheritance
343(1)
Maximizing Polymorphism
343(1)
Summary
344(1)
Key Terms
344(1)
Answers to Self-Test Questions
344(1)
Programming Problems and Activities
345(1)
Recursion, Complexity, and Searching and Sorting
346(34)
Recursion
346(12)
Implementing Recursion
348(1)
Tracing Recursive Calls
348(1)
Guidelines for Writing Recursive Methods
349(1)
When to Use Recursion
350(1)
Towers of Hanoi
350(3)
Eight Queens Problem
353(5)
Complexity Analysis
358(7)
Sum Methods
358(2)
Other O(n) Methods
360(1)
An O(n2) Method
361(1)
Common Big-O Values
362(1)
An O(rn) Method
363(2)
Binary Search
365(3)
Quicksort
368(4)
Case Study: Comparing Sort Algorithms
372(4)
Design, Testing, and Debugging Hints
376(1)
Summary
376(1)
Key Terms
377(1)
Answers to Self-Test Questions
377(1)
Programming Problems and Activities
378(2)
Simple Two-Dimensional Graphics
380(48)
The Conceptual Framework for Computer Graphics
380(6)
The Graphics Class
381(2)
Adding a Panel to a Window
383(1)
Implementing a Panel Class and the Method paintComponent
384(1)
Finding the Height and Width of a Panel
385(1)
The Method repaint
386(1)
Case Study: Drawing Different Shapes
386(3)
The Method getGraphics
389(1)
Graphics Methods and Constructors
390(1)
The Transient Image Problem
390(1)
Color
390(3)
Setting a Panel's Background Color
392(1)
Case Study: Fractals
393(3)
Graphing Data
396(7)
Line Graphs
396(4)
Bar Graphs
400(1)
Pie Charts
401(2)
Case Study: Multiple Views of Data
403(3)
Responding to Mouse Events
406(1)
Case Study: A Very Primitive Drawing Program
407(4)
Transient and Refreshable Images
411(1)
Defining and Using a Geometric Class
412(2)
Implementation of the Circle Class
413(1)
Case Study: Dragging Circles
414(6)
Text Properties
420(1)
The Font Class
420(1)
Setting the Color and Font Properties of Text
421(1)
Design, Testing, and Debugging Hints
421(1)
Summary
422(1)
Key Terms
422(1)
Answers to Self-Test Questions
422(2)
Programming Problems and Activities
424(4)
Files
428(38)
File Classes
429(2)
File Input
431(7)
Exception Handling
433(1)
Opening and Closing a FileInputStream
434(1)
Reading Data from a Text File
434(1)
Reading Data One Character at a Time
434(1)
Reading Data One Line at a Time
435(1)
Reading Data One Word at a Time
436(2)
Case Study: A Text Analyzer
438(5)
File Output
443(2)
Opening and Closing a FileOutputStream
443(1)
Writing Data to a PrintWriter
443(2)
Case Study: Employees and Payroll
445(7)
Other Input/Output Situations
452(11)
Data Input and Output Streams
452(3)
Serialization and Object Streams
455(2)
Terminal Input and Output
457(3)
File Dialogs
460(3)
Design, Testing, and Debugging Hints
463(1)
Summary
463(1)
Key Terms
463(1)
Answers to Self-Test Questions
463(2)
Programming Problems and Activities
465(1)
Collections
466(42)
Lists
467(4)
Comparison of Arrays and Lists
467(2)
List Methods
469(2)
BreezySwing: Scrolling Lists and Dialogs
471(6)
Scrolling Lists
471(2)
Dialogs
473(4)
Case Study: The Employee Maintenance System
477(9)
Maps
486(3)
Case Study: The Therapist
489(7)
Primitive Types and Wrapper Classes
496(3)
Manipulating Primitive Types in a List
498(1)
A Further Look at Java Collections (Optional)
499(5)
Sets
499(1)
Iterators
500(1)
Printing the Items in a Set
500(1)
Forming the Intersection of Two Sets
501(1)
Printing the Items in a Map
501(1)
Sorted Sets and Sorted Maps
502(1)
The Collection Interface
502(2)
Design, Testing, and Debugging Hints
504(1)
Summary
505(1)
Key Terms
505(1)
Answers to Self-Test Questions
505(1)
Programming Problems and Activities
506(2)
Array and Linked Implementations of Lists
508(48)
Interfaces, Abstract Data Types, and Prototypes
508(2)
IndexedList Interface
510(2)
Fixed Size Array Implementation of IndexedList
512(2)
Singly Linked Implementation of IndexedList
514(10)
Coding with Nodes
514(4)
The SLIndexedList Class
518(2)
The locateNode Method
520(1)
The get and set Methods
521(1)
The remove Method
521(2)
The add Method
523(1)
Testing the IndexedList Implementations
524(4)
Complexity Analysis of Indexed Lists
528(2)
Memory Usage
528(1)
Run-Time Efficiency
528(2)
PositionalList Interface
530(8)
Navigating
531(1)
Adding an Object
532(1)
Removing an Object
532(1)
Setting an Object
533(1)
An Extended Example
533(2)
The Interface
535(3)
Fixed Size Array Implementation of PositionalList
538(3)
Doubly Linked Implementation of PositionalList
541(5)
The add Method
545(1)
Complexity Analysis of Positional Lists
546(1)
Stacks and Queues
547(5)
Stacks
547(2)
List-Based Implementation of Stacks
549(1)
Queues
550(1)
List-Based Implementation of Queues
551(1)
Summary
552(1)
Key Terms
552(1)
Answers to Self-Test Questions
553(1)
Programming Problems and Activities
554(2)
Introduction to HTML and Applets
556(29)
Hypertext, Hypermedia, and the World Wide Web
556(2)
Hypertext and Hypermedia
557(1)
Networks and the World Wide Web
557(1)
Overview of the Hypertext Markup Language
558(4)
A Short Example
559(1)
Markup Tags
560(1)
Minimal Document Structure
560(1)
Commenting an HTML Document
561(1)
Simple Text Elements
562(2)
Headings
562(1)
Paragraphs
562(1)
Forced Line Breaks
563(1)
Preformatted Text
564(1)
Character-Level Formatting
564(1)
Escape Sequences
564(1)
Lists
565(3)
An Unnumbered List Example
566(1)
A Definition List Example
566(1)
A Nested List Example
567(1)
Linking to Other Documents
568(3)
Path Names
569(1)
URLs
570(1)
Multimedia
571(2)
Inline Images
571(1)
External Images
571(1)
Colors and Backgrounds
572(1)
Other Media
572(1)
Tables
573(3)
Typical Table Format
574(1)
A Simple Example
575(1)
Applets
576(4)
Example
576(1)
Converting an Application to an Applet
577(2)
Using the Applet Viewer
579(1)
Constraints on Applets
579(1)
Passing Parameters to Applets
580(1)
Design, Testing, and Debugging Hints
580(1)
Summary
581(1)
Key Terms
581(1)
Answers to Self-Test Questions
581(3)
Programming Problems and Activities
584(1)
Swing and AWT
585(83)
The Swing and AWT Philosophy
585(1)
Conversion Program Implemented with GBFrame
586(2)
Conversion Program Implemented with Swing and AWT
588(6)
The Interface
589(1)
The File ConversionWithSwing.java
589(3)
The File FahrenheitButtonListener.java
592(1)
The File CelsiusButtonListener.java
593(1)
The File GenericWindowListener.java
593(1)
Variations on Implementing with Swing and AWT
594(3)
Simplifying the GenericWindowListener Class
594(1)
Incorporating the Listeners into the Main GUI Class
595(2)
GUI Components
597(6)
The Component Class Hierarchy
598(1)
Panels
598(1)
Scroll Bars
599(1)
Sliders
599(1)
Menu Components
599(2)
Option Panes
601(1)
Container Classes
601(2)
Layouts
603(11)
Border Layouts
604(1)
Flow Layouts
605(2)
Grid Layouts
607(1)
Grid Bag Layouts
608(3)
Card Layouts
611(1)
Panels
612(2)
Events
614(3)
Events and Components
614(1)
Events and Listeners
614(2)
Events and Their Methods
616(1)
Dialogs
617(5)
The Model/View/Controller Pattern
622(1)
Case Study: A Color Meter Application
623(7)
Applets, Swing, and AWT
630(1)
Setting the Look and Feel
631(1)
Summary
632(1)
Key Terms
632(1)
Answers to Self-Test Questions
632(1)
Programming Problems and Activities
633(1)
Appendixes
A Java Resources
634(11)
B Reserved Words
645(1)
C Operator Precedence
646(2)
D ASCII Character Set
648(1)
E Number Systems
649(3)
F Java Exception Handling
652(2)
G Java Packages
654(1)
H BreezySwing and TerminallO
655(13)
H.1 BreezySwing
655(1)
H.2 Method Specifications for Classes GBFrame, GBApplet, and GBDialog
656(4)
H.3 Method Specifications for Class GBDialog
660(1)
H.4 Method Specifications for Class GBPanel
660(1)
H.5 Method Specifications for Class Format
661(1)
H.6 Method Specifications for Window Objects
662(3)
H.7 TerminalIO
665(3)
Glossary 668(11)
Case Studies Index 679(1)
Java Classes Index 680(1)
Subject Index 681

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.