Java: An Introduction to Problem Solving and Programming / Edition 6

Paperback (Print)
Rent
Rent from BN.com
$24.66
(Save 83%)
Est. Return Date: 02/24/2015
Used and New from Other Sellers
Used and New from Other Sellers
from $17.79
Usually ships in 1-2 business days
(Save 88%)
Other sellers (Paperback)
  • All (16) from $17.79   
  • New (1) from $89.33   
  • Used (15) from $17.79   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$89.33
Seller since 2014

Feedback rating:

(6)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
0132162709 Online access code included! Ships same or next business day w/ free tracking. Choose Expedited shipping for fastest (2-6 business day) delivery. Satisfaction Guaranteed

Ships from: Troy, MI

Usually ships in 1-2 business days

  • Standard, 48 States
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing All
Close
Sort by

Overview

Introductory Programming / Java™
Read More Show Less

Editorial Reviews

From the Publisher
"The consistent usage of examples throughout the book is excellent. I rely heavily on examples for instruction as there is no better way to teach programming." — Joan Boone, University of North Carolina, Chapel Hill
Read More Show Less

Product Details

  • ISBN-13: 9780132162708
  • Publisher: Addison-Wesley
  • Publication date: 2/28/2011
  • Series: MyprogrammingLab Series
  • Edition description: Older Edition
  • Edition number: 6
  • Pages: 984
  • Product dimensions: 7.30 (w) x 8.90 (h) x 1.40 (d)

Meet the Author

Walter Savitch received his Ph.D. degree in Mathematics from the University of California at Berkeley in 1969. Since that time he has been on the faculty at the University of California at San Diego and is currently a Professor of Computer Science and director of the Interdisciplinary Ph.D. Program in Cognitive Science. Professor Savitch’s research areas include complexity theory, formal language theory, computational linguistics, and the development of computer science education materials. In addition to writing numerous research articles and involvement in other editorial projects, he has written a number of well-known computer science textbooks, including Pascal, Ada, and C++ CS1 and CS2 textbooks.

Contributing author, Kenrick Mock, is an Associate Professor at the University of Alaska–Anchorage. He has also taught at Washington State University, Portland State University, and the University of California–Davis. He teaches undergraduate computer science courses across the curriculum including introductory C++, Java™, Visual Basic® for non-programmers, algorithms, computer security, and artificial intelligence. With the Coastal Marine Institute at UAA, he helped develop a computer system to aid in research about Alaska sea ice and the atmosphere. Before becoming a teacher, Mock was a research scientist and software engineer at Intel™. He received a PhD in computer science from UC Davis.

Read More Show Less

Table of Contents


Chapter 1 Introduction to Computers and Java 1

1.1 COMPUTER BASICS 2

Hardware and Memory 3

Programs 6

Programming Languages, Compilers, and Interpreters 7

Java Bytecode 9

Class Loader 11

1.2 A SIP OF JAVA 12

History of the Java Language 12

Applications and Applets 13

A First Java Application Program 14

Writing, Compiling, and Running a Java Program 19

1.3 PROGRAMMING BASICS 21

Object-Oriented Programming 21

Algorithms 25

Testing and Debugging 27

Software Reuse 28

1.4 GRAPHICS SUPPLEMENT 30

A Sample Graphics Applet 30

Size and Position of Figures 32

Drawing Ovals and Circles 34

Drawing Arcs 35

Running an Applet 37

Chapter 2 Basic Computation 47

2.1 VARIABLES AND EXPRESSIONS 48

Variables 49

Data Types 51

Java Identifiers 53

Assignment Statements 55

Simple Input 58

Simple Screen Output 60

Constants 60

Named Constants 62

Assignment Compatibilities 63

Type Casting 65

Arithmetic Operators 68

Parentheses and Precedence Rules 71

Specialized Assignment Operators 72

Case Study: Vending Machine Change 74

Increment and Decrement Operators 79

More About the Increment and Decrement Operators 80

2.2 THE CLASS STRING 81

String Constants and Variables 81

Concatenation of Strings 82

String Methods 83

String Processing 85

Escape Characters 88

The Unicode Character Set 89

2.3 KEYBOARD AND SCREEN I/O 91

Screen Output 91

Keyboard Input 94

Other Input Delimiters (Optional) 99

Formatted Output with printf (Optional) 101

2.4 DOCUMENTATION AND STYLE 103

Meaningful Variable Names 103

Comments 104

Indentation 107

Using Named Constants 107

2.5 GRAPHICS SUPPLEMENT 109

Style Rules Applied to a Graphics Applet 110

Creating a Java GUI Application with the JFrame Class 110

Introducing the Class JOptionPane 113

Reading Input as Other Numeric Types 123

Programming Example: Change-Making Program

with Windowing I/O 124

Chapter 3 Flow of Control: Branching 139

3.1 THE IF-ELSE STATEMENT 140

The Basic if-else Statement 141

Boolean Expressions 148

Comparing Strings 153

Nested if-else Statements 158

Multibranch if-else Statements 160

Programming Example: Assigning Letter Grades 162

Case Study: Body Mass Index 165

The Conditional Operator (Optional) 168

The exit Method 168

3.2 THE TYPE BOOLEAN 169

Boolean Variables 170

Precedence Rules 171

Input and Output of Boolean Values 174

3.3 THE SWITCH STATEMENT 176

Enumerations 182

3.4 GRAPHICS SUPPLEMENT 183

Specifying a Drawing Color 184

A Dialog Box for a Yes-or-No Question 187

Chapter 4 Flow of Control: Loops 199

4.1 JAVA LOOP STATEMENTS 200

The while Statement 201

The do-while Statement 204

Programming Example: Bug Infestation 209

Programming Example: Nested Loops 215

The for Statement 217

Declaring Variables within a for Statement 223

Using a Comma in a for Statement (Optional) 224

The for-each Statement 226

4.2 PROGRAMMING WITH LOOPS 226

The Loop Body 227

Initializing Statements 228

Controlling the Number of Loop Iterations 229

Case Study: Using a Boolean Variable to End a Loop 231

Programming Example: Spending Spree 233

The break Statement and continue Statement in Loops

(Optional) 236

Loop Bugs 239

Tracing Variables 241

Assertion Checks 243

4.3 GRAPHICS SUPPLEMENT 245

Programming Example: A Multiface Applet 245

The drawstring Method 250

Chapter 5 Defining Classes and Methods 267

5.1 CLASS AND METHOD DEFINITIONS 269

Class Files and Separate Compilation 271

Programming Example: Implementing a Dog Class 271

Instance Variables 272

Methods 275

Defining void Methods 278

Defining Methods That Return a Value 279

Programming Example: First Try at Implementing a Species Class 284

The Keyword this 288

Local Variables 290

Blocks 292

Parameters of a Primitive Type 293

5.2 INFORMATION HIDING AND ENCAPSULATION 299

Information Hiding 300

Precondition and Postcondition Comments 300

The public and private Modifiers 302

Programming Example: A Demonstration of Why Instance

Variables Should Be Private 305

Programming Example: Another Implementation of a Class

of Rectangles 306

Accessor Methods and Mutator Methods 308

Programming Example: A Purchase Class 312

Methods Calling Methods 316

Encapsulation 322

Automatic Documentation with javadoc 325

UML Class Diagrams 326

5.3 OBJECTS AND REFERENCES 327

Variables of a Class Type 328

Defining an equals Method for a Class 333

Programming Example: A Species Class 337

Boolean-Valued Methods 340

Case Study: Unit Testing 342

Parameters of a Class Type 344

Programming Example: Class-Type Parameters Versus

Primitive-Type Parameters 348

5.4 GRAPHICS SUPPLEMENT 352

The Graphics Class 352

Programming Example: Multiple Faces, but with a Helping Method 354

The Graphics2D Class and the Java2DTM API 358

The init Method 360

Adding Labels to an Applet 361

Chapter 6 More About Objects and Methods 383

6.1 CONSTRUCTORS 383

Defining Constructors 385

Calling Methods from Constructors 394

Calling a Constructor from Other Constructors (Optional) 397

6.2 STATIC VARIABLES AND STATIC METHODS 399

Static Variables 399

Static Methods 400

Dividing the Task of a main Method into Subtasks 407

Adding a main Method to a Class 408

The Math Class 410

Wrapper Classes 413

6.3 WRITING METHODS 419

Case Study: Formatting Output 419

Decomposition 425

Addressing Compiler Concerns 426

Testing Methods 428

6.4 OVERLOADING 430

Overloading Basics 430

Overloading and Automatic Type Conversion 433

Overloading and the Return Type 436

Programming Example: A Class for Money 438

6.5 INFORMATION HIDING REVISITED 445

Privacy Leaks 445

6.6 ENUMERATION AS A CLASS 449

6.7 PACKAGES 451

Packages and Importing 452

Package Names and Directories 453

Name Clashes 456

6.8 GRAPHICS SUPPLEMENT 457

Adding Buttons 457

Event-Driven Programming 459

Programming Buttons 459

Programming Example: A Complete Applet with Buttons 463

Adding Icons 466

Changing Visibility 468

Programming Example: An Example of Changing Visibility 468

Chapter 7 Arrays 491

7.1 ARRAY BASICS 493

Creating and Accessing Arrays 494

Array Details 497

The Instance Variable length 500

More About Array Indices 503

Initializing Arrays 506

7.2 ARRAYS IN CLASSES AND METHODS 508

Case Study: Sales Report 508

Indexed Variables as Method Arguments 516

Entire Arrays as Arguments to a Method 519

Arguments for the Method main 520

Array Assignment and Equality 521

Methods That Return Arrays 524

7.3 PROGRAMMING WITH ARRAYS AND CLASSES 528

Programming Example: A Specialized List Class 528

Partially Filled Arrays 536

7.4 SORTING AND SEARCHING ARRAYS 538

Selection Sort 538

Other Sorting Algorithms 542

Searching an Array 544

7.5 MULTIDIMENSIONAL ARRAYS 545

Multidimensional-Array Basics 546

Multidimensional-Array Parameters and Returned Values 549

Java’s Representation of Multidimensional Arrays 552

Ragged Arrays (Optional) 553

Programming Example: Employee Time Records 555

7.6 GRAPHICS SUPPLEMENT 561

Text Areas and Text Fields 561

Programming Example: A Question-and-Answer Applet 561

The Classes JTextArea and JTextField 564

Drawing Polygons 566

Chapter 8 Inheritance, Polymorphism, and

Interfaces 589

8.1 INHERITANCE BASICS 590

Derived Classes 592

Overriding Method Definitions 596

Overriding Versus Overloading 597

The final Modifier 597

Private Instance Variables and Private Methods of a Base Class 598

UML Inheritance Diagrams 600

8.2 PROGRAMMING WITH INHERITANCE 603

Constructors in Derived Classes 603

The this Method–Again 605

Calling an Overridden Method 605

Programming Example: A Derived Class of a Derived Class 606

Another Way to Define the equals Methods in Undergraduate 611

Type Compatibility 611

The Class Object 616

A Better equals Method 618

8.3 POLYMORPHISM 620

Dynamic Binding and Inheritance 620

Dynamic Binding with toString 623

8.4 INTERFACES AND ABSTRACT CLASSES 625

Class Interfaces 625

Java Interfaces 626

Implementing an Interface 627

An Interface as a Type 629

Extending an Interface 632

Case Study: Character Graphics 633

Case Study: The Comparable Interface 646

Abstract Classes 650

8.5 GRAPHICS SUPPLEMENT 652

The Class JApplet 653

The Class JFrame 653

Window Events and Window Listeners 656

The ActionListener Interface 658

What to Do Next 658

Chapter 9 Exception Handling 671

9.1 BASIC EXCEPTION HANDLING 672

Exceptions in Java 673

Predefined Exception Classes 683

9.2 DEFINING yOUR OWN EXCEPTION CLASSES 685

9.3 MORE ABOUT EXCEPTION CLASSES 695

Declaring Exceptions (Passing the Buck) 695

Kinds of Exceptions 698

Errors 700

Multiple Throws and Catches 701

The finally Block 707

Rethrowing an Exception (Optional) 708

Case Study: A Line-Oriented Calculator 709

9.4 GRAPHICS SUPPLEMENT 721

Exceptions in GUIs 721

Programming Example: A JFrame GUI Using Exceptions 721

Chapter 10 Streams, File I/O, and Networking 739

10.1 AN OVERVIEW OF STREAMS AND FILE I/O 741

The Concept of a Stream 741

Why Use Files for I/O? 742

Text Files and Binary Files 742

10.2 TEXT-FILE I/O 744

Creating a Text File 744

Appending to a Text File 750

Reading from a Text File 752

10.3 TECHNIQUES FOR ANY FILE 755

The Class File 755

Programming Example: Reading a File Name

from the Keyboard 755

Using Path Names 757

Methods of the Class File 758

Defining a Method to Open a Stream 760

Case Study: Processing a Comma-Separated Values File 762

10.4 BASIC BINARY-FILE I/O 765

Creating a Binary File 765

Writing Primitive Values to a Binary File 767

Writing Strings to a Binary File 770

Some Details About writeUTF 771

Reading from a Binary File 772

The Class EOFException 778

Programming Example: Processing a File of Binary Data 780

10.5 BINARY-FILE I/O WITH OBJECTS AND ARRAYS 785

Binary-File I/O with Objects of a Class 785

Some Details of Serialization 789

Array Objects in Binary Files 790

10.6 NETWORK COMMUNICATION WITH STREAMS 793

10.7 GRAPHICS SUPPLEMENT 799

Programming Example: A JFrame GUI for Manipulating Files 799

Chapter 11 Recursion 821

11.1 THE BASICS OF RECURSION 822

Case Study: Digits to Words 826

How Recursion Works 830

Infinite Recursion 834

Recursive Methods Versus Iterative Methods 836

Recursive Methods That Return a Value 838

11.2 PROGRAMMING WITH RECURSION 842

Programming Example: Insisting That User Input Be Correct 842

Case Study: Binary Search 844

Programming Example: Merge Sort—A Recursive Sorting Method 852

Chapter 12 Dynamic Data Structures and Generics 869

12.1 ARRAY-BASED DATA STRUCTURES 871

The Class ArrayList 872

Creating an Instance of ArrayList 872

Using the Methods of ArrayList 874

Programming Example: A To-Do List 878

Parameterized Classes and Generic Data Types 881

12.2 THE JAVA COLLECTIONS FRAMEWORK 881

The Collection Interface 881

The Class HashSet 882

The Map Interface 884

The Class HashMap 884

12.3 LINKED DATA STRUCTURES 887

The Class LinkedList 887

Linked Lists 888

Implementing the Operations of a Linked List 891

A Privacy Leak 898

Inner Classes 899

Node Inner Classes 900

Iterators 900

The Java Iterator Interface 912

Exception Handling with Linked Lists 912

Variations on a Linked List 914

Other Linked Data Structures 916

12.4 GENERICS 917

The Basics 917

Programming Example: A Generic Linked List 920

APPENDICES

1 Getting Java 941

2 Running Applets 942

3 Protected and Package Modifiers 944

4 The DecimalFormat Class 945

Other Pattern Symbols 946

5 Javadoc 949

Commenting Classes for Use within javadoc 949

Running javadoc 950

6 Differences Between C++ and Java 952

Primitive Types 952

Strings 952

Flow of Control 952

Testing for Equality 953

main Method (Function) and Other Methods 953

Files and Including Files 953

Class and Method (Function) Definitions 954

No Pointer Types in Java 954

Method (Function) Parameters 954

Arrays 954

Garbage Collection 955

Other Comparisons 955

7 Unicode Character Codes 956

8 Introduction to Java 8 Functional Programming 957

INDEX 962

Read More Show Less

Customer Reviews

Average Rating 4
( 2 )
Rating Distribution

5 Star

(0)

4 Star

(2)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted October 16, 2012

    Good beginner's guide, but...

    I was disappointed to learn that nook textbooks are not view-able on non-nook tablets. I felt deceived, since the nook for android app page lists only the possible uses of the app, and not it's limitations. I recently bought an android tablet, and I assumed that because nook tablets are built on android, I would be able to read my textbooks within the nook app for android. Unfortunately, it seems that Barnes & Noble has followed Amazon's lead in allowing e-textbooks to be read only on proprietary tablets, in addition to desktop applications. If you have an android tablet and want to view this book on it, I would recommend looking at other sources.

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 28, 2012

    No text was provided for this review.

Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)