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.

9781576760598

Computing with Java : Programs, Objects, Graphics

by
  • ISBN13:

    9781576760598

  • ISBN10:

    1576760596

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2002-01-01
  • Publisher: Addison Wesley
  • View Upgraded Edition
  • 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: $104.40
We're Sorry.
No Options Available at This Time.

Summary

Gittleman's easy to follow book covers almost everything you need to know about Java. Topics covered include software engineering, object-oriented programming, event-driven programming and basic Java constructs.This book is designed for readers with no knowledge of Java, and no prior computing background.

Table of Contents

Preface ix
Computing with Java
1(24)
Introduction to Computing
2(4)
Hardware
2(1)
Software
2(1)
Imaginary Processor ABC
3(1)
Imaginary Processor XYZ
3(1)
High-Level Languages
3(1)
Compilers
4(1)
Interpreters
4(1)
Networks
5(1)
Overview of Java
6(2)
History
6(1)
Java's Features
6(1)
How Java Works
7(1)
Running Java Programs and Applets
8(6)
Editing, Compiling, and Running a Java Application
8(3)
Editing, Compiling, and Running a Java Applet
11(2)
A Graphical Applet
13(1)
Program-Driven vs. Event-Driven Applications
14(4)
The Character Mode
15(1)
The Graphical User Interface (GUI)
16(2)
Procedural vs. Object-Oriented Programming
18(2)
Procedural Programming
18(1)
Object-Oriented Programming
19(1)
A First Look at Everything: A User Interface Example
20(5)
Java Programming Basics
25(40)
Identifiers and Keywords
26(2)
The Character Set
27(1)
Variables, Assignments, and Output
28(7)
Arithmetic Expressions
35(9)
Precedence of Arithmetic Operators
38(2)
Combining Assignment and Arithmetic
40(1)
Increment and Decrement Operators
41(3)
Methods and Parameters
44(6)
Methods
44(4)
Passing by Value
48(2)
Input and A First Look at Packages
50(5)
An Input Dialog
50(1)
Using a Package
51(4)
Getting Started with Objects, Applets, and Events
55(10)
Objects
55(1)
Graphics Model
56(1)
Applets
57(2)
Events
59(6)
Software Engineering with Control Structures
65(58)
Relational Operators and Expressions
67(3)
If and If Else Statements
70(10)
The if Statement
70(2)
Control Flow
72(2)
The If Else Statement
74(2)
Blocks
76(4)
The Type Double
80(8)
Scientific Notation
80(1)
Double Values
81(1)
Output
82(1)
Input and Formatted Output
83(2)
Mixed-Type Expressions
85(3)
Program Design with the While Loop
88(9)
Repetition
88(1)
Planning Programs using Pseudocode
89(7)
Loop Termination
96(1)
Problem-Solving Methods: Stepwise-Refinement
97(9)
Stepwise Refinement
98(2)
The Steps of Stepwise Refinement
100(1)
Finding the Refinements
101(1)
From a Problem Statement to Java Code
101(5)
Debugging
106(3)
Getting Started with Objects and Applets: Drawing Shapes
109(14)
Graphics Drawing
110(3)
Drawing Relative to the Screen
113(10)
More Control Structures and Types
123(70)
The and, or, and Not Operators
124(9)
Conditional and
125(1)
Conditional OR
126(1)
Logical Complement
126(2)
Operator Precedence
128(4)
Combining and with OR
132(1)
Nested Ifs and the Switch Statement
133(15)
Nested If Statements
133(2)
Pairing Else with If
135(4)
The Switch Statement
139(9)
The For and Do-While Loops
148(10)
The For Statement
148(5)
The Do-While Statement
153(5)
Additional Primitive Types
158(6)
The Char Type
158(2)
The Long Type
160(3)
The Byte, Short, and Float Types
163(1)
Using the Math Library
164(7)
Powers and Roots
165(1)
Maximum, Minimum, and Absolute Value
165(1)
Floor and Ceiling
166(1)
Pi and e
166(1)
Random Numbers
167(4)
Solving Problems with Java: An Iterative Development Cycle
171(22)
Defining the Problem
172(1)
Toward a Solution: The Iterative Process-Develop pseudocode, a Java program, and Test
172(1)
Toward a Solution: First Iteration-Pseudocode, Program, Test
172(4)
Toward a Solution: Second Iteration-Pseudocode, Program, Test
176(5)
Completing the Java Code: Third Iteration-Pseudocode, Program, Test
181(3)
Testing the Java Code
184(9)
Getting Started with Object-Oriented Programming
193(52)
Using Objects
194(11)
Defining an Object
194(1)
Strings
195(5)
Values vs. References
200(3)
Comparing Strings
203(2)
Introduction to Object-Oriented Design
205(7)
A Definition
205(1)
Use Cases and Scenarios
206(2)
Scenarios for an ATM system
208(1)
Classification
209(3)
Classes and Objects in Java
212(15)
The Structure of the BankAccount Class
212(1)
Instance Variables
213(1)
Instance Methods
214(1)
Constructors
215(2)
Using BankAccount Objects
217(1)
Creating Objects
217(2)
Making an Object Behave
219(3)
Method Overloading
222(1)
Class Variables and Methods
222(5)
The QuickFood Example
227(5)
Class Diagrams
227(1)
Sequence Diagrams
228(4)
Object Composition
232(13)
Event-Driven Programming
245(36)
The World Wide Web and Applets
247(5)
Protocols
247(1)
Clients and Servers
247(1)
The URL
247(1)
HTML
248(4)
Paint Events
252(4)
Responding to Paint Events
253(3)
Drawing Text
256(5)
Fonts
256(1)
Initializing an Applet
257(1)
Font Metrics
258(3)
Using Color
261(4)
Creating Colors
261(2)
3D Rectangles
263(2)
Interfaces
265(4)
Declaring an Interface
265(2)
Implementing an Interface
267(2)
Event Listeners
269(4)
A First Look at Inheritance and the AWT
273(8)
The Component Class
273(1)
Introducing Inheritance
274(1)
The Container Class
274(7)
User Interfaces
281(44)
Using a Layout
284(5)
The Component Hierarchy
284(1)
Adding Buttons to a Container
285(1)
Flow Layout
285(2)
Drawing on a Canvas
287(2)
Button and TextField
289(11)
The Java Event Model and Action Events
289(1)
Making Buttons Work
290(1)
Using Labels
291(4)
Number Formatting
295(1)
Wrapper Classes
296(1)
Entering Data in Text Fields
297(3)
Checkbox and Choice
300(8)
Inner Classes
300(1)
Checkbox and Choice with a Button
301(4)
Checkbox and Choice Item Events
305(3)
Border and Grid Layouts
308(6)
The Border Layout
308(3)
Panels
311(1)
The Grid Layout
312(2)
List and TextArea
314(11)
List
314(1)
TextArea
314(1)
StringBuffer
315(10)
Arrays
325(60)
Using Arrays
327(6)
Changing an Array
330(3)
Reference versus Value Again
333(8)
Creating an Array
335(6)
Passing Array Arguments and Returning Arrays
341(9)
Passing an Array Argument: The display Method
342(2)
Returning an Array: The readIntArray Method
344(1)
Changing an Array: The reverse Method
344(2)
An Example: Using Methods to Name Operations
346(4)
An Example: Simulating Rolls of the Dice
350(3)
Arrays of Arrays
353(3)
Solving Problems with Java: Insertion Sort
356(11)
Defining the Problem
356(2)
Toward a Solution: Developing the Pseudocode
358(3)
Toward a Solution: Alternatives
361(1)
Completing the Java Code
361(3)
Testing the Code
364(3)
A GUI for Insertion Sorting
367(18)
Defining the Problem
367(1)
Designing a Solution: The Exploratory Process
367(1)
Designing a Solution: Making a Chart
368(2)
Designing a Solution: Sorting
370(2)
Designing a Solution: The User Interface
372(2)
Completing the Java Code: Making the User Interface Work
374(4)
Testing the Code
378(7)
Inheritance
385(58)
Subclasses
386(11)
Classification Revisited
386(1)
Class Hierarchies
386(1)
Constructing a Subclass
387(3)
Adding State and Behavior to a Subclass
390(2)
Overriding Behavior
392(4)
The Object Class
396(1)
Polymorphism
397(9)
Polymorphic Operations
398(1)
Compile-time and Run-time Types
398(4)
The BankAccount Hierarchy
402(4)
Abstract Classes
406(8)
Declaring an Abstract Class
406(1)
Polymorphism and Abstract Classes
407(1)
A Shape Class
407(3)
Line and Circle
410(4)
Modifiers and Access
414(10)
A Second Look at Packages
414(2)
Classpath
416(1)
Class (and Interface) Visibility
416(1)
Data Field and Method Visibility
417(1)
Access to Data Fields
417(2)
Access to Methods
419(5)
Object-Oriented Design with Use Cases and Scenarios
424(19)
Defining the Problem
424(1)
Object-Oriented Design-Developing Scenarios
424(1)
Object-Oriented Design-Assigning Responsibilities
425(1)
Object-Oriented Design-Defining the Classes
426(1)
Completing the Java Code
427(8)
Testing the Code
435(8)
Window, Mouse, and Key Events
443(50)
Closing Windows
444(7)
Frames
445(1)
Window Events and WindowListener
445(2)
Adapter Classes
447(1)
WindowAdapter
448(3)
Applets <-- --> Standalone Applications
451(7)
Applets to Applications
451(2)
Console Application to GUI Application
453(4)
Standalone Application to Applet
457(1)
Using the Mouse
458(8)
Mouse Events
458(1)
MouseListener and MouseMotionListener
458(4)
Moving the Mouse
462(2)
MouseAdapter
464(2)
Using the Keyboard
466(5)
Focus
466(1)
Key Events
467(1)
KeyListener
467(4)
Solving Problems with Java: Drawing the Tangram Puzzle
471(7)
Defining the Problem
471(2)
Designing a Solution: Starting with One Polygon
473(1)
Designing a Solution: Solving a Simpler Problem
474(2)
Completing the Java Code
476(1)
Testing the Code
477(1)
Solving Problems with Java: Tangrams with the Mouse and Keys
478(15)
Defining the Problem
478(1)
Designing a Solution: Solving a Subproblem-Rotating a Polygon
478(3)
Completing the Java Code
481(4)
Testing the Code
485(8)
Exception Handling and Input/Output
493(42)
Program Arguments and Applet Parameters
494(5)
Program Arguments
494(2)
Applet Parameters
496(3)
Exception Handling
499(8)
Exception Classes
500(1)
The Array Index Out of Bounds Exception
500(5)
The Number Format Exception
505(2)
Text File Input and Output
507(11)
Reading from a File
508(1)
Reading Lines and Fields
509(4)
Writing to a File
513(2)
Reading an Integer
515(3)
Binary and Object Input and Output
518(17)
The File Class
518(1)
Reading and Writing Bytes
519(3)
Reading and Writing Primitive Types
522(2)
Random Access Files
524(1)
Reading and Writing Objects
525(10)
Swing Components
535(38)
Starting to Swing
536(8)
The Swing Classes
536(1)
Converting an AWT Applet to Swing
536(4)
Text Components and Labels
540(1)
A Swing Application with Look and Feel Demo
540(4)
Images and Buttons
544(6)
Images
544(1)
Buttons
545(3)
Automatic Double Buffering
548(2)
Lists and Toggle Buttons
550(7)
Lists
550(1)
Scroll Panes
550(1)
Checkboxes
551(3)
Radio Buttons
554(1)
Combo Boxes
554(3)
Menus and Dialogs
557(7)
Menus
557(1)
Dialogs
557(7)
Tabs and Tables
564(9)
Tabbed Panes
564(2)
Tables
566(7)
Data Structures
573(40)
Recursion: Searching and Sorting
574(9)
Binary Search
577(3)
Merge Sort
580(3)
Linked Lists
583(5)
Stacks and Queues
588(10)
Stacks
588(6)
Queues
594(4)
Vectors and Enumerations
598(6)
Hash Tables
604(9)
Collections
613(38)
The Collection Interfaces and Classes
614(7)
The Collection Interface
614(1)
Sets
615(2)
Iterators
617(4)
Lists
621(7)
Implementations
622(6)
Maps
628(8)
Implementations
629(7)
Comparisons and Ordering
636(8)
Inheriting From Object
636(2)
Overriding Object Methods
638(2)
The Comparable Interface
640(2)
Sorted Sets and Maps
642(2)
Algorithms
644(7)
Multimedia and Networking
651(40)
Introduction to Threads
652(5)
The Thread Class
652(3)
The Runnable Interface
655(2)
Animation
657(9)
Images
666(7)
Double Buffering
669(2)
Using Swing
671(2)
Sound
673(3)
Introduction to Networking
676(15)
Writing a Server and a Client
678(13)
Appendix A-Binary and Hexadecimal Numbers 691(4)
Appendix B-Bitwise and Shift Operators 695(4)
Appendix C-Operator Precedence Table 699(2)
Appendix D-The ASCII Character Set 701(2)
Appendix E-Using Java in Various Environments 703(6)
Answers to Selected Exercises 709(20)
Index 729

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