Textbook

# Big Java: Late Objects

February 2012, ©2013

## Description

Big Java: Late Objects is a comprehensive introduction to Java and computer programming, which focuses on the principles of programming, software engineering, and effective learning. It is designed for a two-semester first course in programming for computer science students.

See More

## Table of Contents

Preface v

Special Features xxvi

Chapter 1 INTRODUCTION 1

1.1 Computer Programs 2

1.2 The Anatomy of a Computer 3

1.3 The Java Programming Language 5

1.4 Becoming Familiar with Your Programming Environment 8

1.5 Analyzing Your First Program 12

1.6 Errors 15

1.7 Problem Solving: Algorithm Design 16

Chapter 2 FUNDAMENTAL DATA TYPES 29

2.1 Variables 30

2.2 Arithmetic 41

2.3 Input and Output 48

2.4 Problem Solving: First Do It By Hand 57

2.5 Strings 59

Chapter 3 DECISIONS 81

3.1 The if Statement 82

3.2 Comparing Numbers and Strings 88

3.3 Multiple Alternatives 96

3.4 Nested Branches 100

3.5 Problem Solving: Flowcharts 105

3.6 Problem Solving: Test Cases 108

3.7 Boolean Variables and Operators 111

3.8 Application: Input Validation 116

Chapter 4 LOOPS 139

4.1 The while Loop 140

4.2 Problem Solving: Hand-Tracing 147

4.3 The for Loop 150

4.4 The do Loop 156

4.5 Application: Processing Sentinel Values 158

4.6 Problem Solving: Storyboards 162

4.7 Common Loop algorithms 165

4.8 Nested Loops 172

4.9 Application: Random Numbers and Simulations 176

Chapter 5 METHODS 201

5.1 Methods as Black Boxes 202

5.2 Implementing Methods 204

5.3 Parameter Passing 207

5.4 Return Values 210

5.5 Methods Without Return Values 214

5.6 Problem Solving: Reusable Methods 215

5.7 Problem Solving: Stepwise Refinement 218

5.8 Variable Scope 225

5.9 Recursive Methods (Optional) 228

Chapter 6 ARRAYS AND ARRAY LISTS 249

6.1 Arrays 250

6.2 The Enhanced for Loop 257

6.3 Common Array Algorithms 258

6.4 Using Arrays with Methods 268

6.5 Problem Solving: Adapting Algorithms 272

6.6 Problem Solving: Discovering Algorithms by Manipulating Physical Objects 279

6.7 Two-Dimensional Arrays 282

6.8 Array Lists 289

Chapter 7 INPUT/OUTPUT AND EXCEPTION HANDLING 317

7.1 Reading and Writing Text files 318

7.2 Text Input and Output 323

7.3 Command Line Arguments 330

7.4 Exception Handling 337

7.5 Application: Handling Input Errors 347

Chapter 8 OBJECTS AND CLASSES 361

8.1 Object-Oriented Programming 362

8.2 Implementing a Simple Class 364

8.3 Specifying the Public Interface of a Class 367

8.4 Designing the Data representation 371

8.5 Implementing Instance Methods 372

8.6 Constructors 375

8.7 Testing a Class 380

8.8 Problem Solving: Tracing Objects 386

8.9 Problem Solving: Patterns for Object Data 388

8.10 Object References 395

8.11 Static Variables and Methods 400

Chapter 9 INHERITANCE AND INTERFACES 415

9.1 Inheritance Hierarchies 416

9.2 Implementing Subclasses 420

9.3 Overriding Methods 424

9.4 Polymorphism 430

9.5 Object: The Cosmic Superclass 441

9.6 Interface Types 448

Chapter 10 GRAPHICAL USER INTERFACES 465

10.1 Frame Windows 466

10.2 Events and Event Handling 470

10.3 Processing Text Input 481

10.4 Creating Drawings 487

Chapter 11 ADVANCED USER INTERFACES 507

11.1 Layout Management 508

11.2 Choices 510

11.3 Menus 521

11.4 Exploring the Swing Documentation 528

11.5 Using Timer events for Animations 533

11.6 Mouse Events 536

Chapter 12 OBJECT-ORIENTED DESIGN 549

12.1 Classes and Their Responsibilities 550

12.2 Relationships Between Classes 554

12.3 Application: Printing an Invoice 562

12.4 Packages 574

Chapter 13 RECURSION 585

13.1 Triangle Numbers Revisited 586

13.2 Problem Solving: Thinking Recursively 590

13.3 Recursive Helper Methods 594

13.4 The Efficiency of Recursion 596

13.5 Permutations 601

13.6 Mutual Recursion 606

13.7 Backtracking 612

Chapter 14 SORTING AND SEARCHING 627

14.1 Selection Sort 628

14.2 Profiling the Selection Sort Algorithm 631

14.3 Analyzing the Performance of the Selection Sort Algorithm 634

14.4 Merge Sort 639

14.5 Analyzing the Merge Sort Algorithm 642

14.6 Searching 646

14.7 Problem Solving: Estimating the Running Time of an Algorithm 651

14.8 Sorting and Searching in the Java Library 656

Chapter 15 THE JAVA COLLECTIONS FRAMEWORK 669

15.1 An Overview of the Collections Framework 670

15.2 Linked Lists 672

15.3 Sets 679

15.4 Maps 684

15.5 Stacks, Queues, and Priority Queues 690

15.6 Stack and Queue Applications 693

Chapter 16 BASIC DATA STRUCTURES 713

16.1 Implementing Linked Lists 714

16.2 Implementing Array Lists 728

16.3 Implementing Stacks and Queues 733

16.4 Implementing a Hash Table 739

Chapter 17 TREE STRUCTURES 759

17.1 Basic Tree Concepts 760

17.2 Binary Trees 764

17.3 Binary Search Trees 769

17.4 Tree Traversal 778

17.5 Red-Black Trees 784

17.6 Heaps 791

17.7 The Heapsort Algorithm 802

Chapter 18 GENERIC CLASSES 817

18.1 Generic Classes and Type Parameters 818

18.2 Implementing Generic Types 819

18.3 Generic Methods 823

18.4 Constraining Type Parameters 825

18.5 Type Erasure 829

Chapter 18 STREAMS AND BINARY INPUT/OUTPUT 839

19.1 Readers, Writers, and Streams 840

19.2 Binary Input and Output 841

19.3 Random Access 845

19.4 Object Streams 851

Chapter 20 MULTITHREADING (WEB ONLY)

20.1 Running Threads

20.2 Terminating Threads

20.3 Race Conditions

20.4 Synchronizing Object Access

20.5 Avoiding Deadlocks

20.6 Application: Algorithm Animation

Chapter 21 INTERNET NETWORKING (WEB ONLY)

21.1 The Internet Protocol

21.2 Application Level Protocols

21.3 A Client Program

21.4 A Server Program

21.5 URL Connections

Chapter 22 RELATIONAL DATABASES (WEB ONLY)

22.1 Organizing Database Information

22.2 Queries

22.3 Installing a Database

22.4 Database Programming in Java

22.5 Application: Entering an Invoice

Chapter 23 XML (WEB ONLY)

23.1 XML Tags and Documents

23.2 Parsing XML Documents

23.3 Creating XML Documents

23.4 Validating XML Documents

Chapter 24 WEB APPLICATIONS (WEB ONLY)

24.1 The Architecture of a Web Application

24.2 The Architecture of a JSF Application

24.3 Javabeans Components

24.4 Navigation Between Pages

24.5 JSF Components

24.6 A Three-Tier Application

APPENDICES

APPENDIX A THE BASIC LATIN AND LATIN-1 SUBSETS OF UNICODE 861

APPENDIX B JAVA OPERATOR SUMMARY 865

APPENDIX C JAVA RESERVED WORD SUMMARY 867

APPENDIX D THE JAVA LIBRARY 869

APPENDIX E JAVA SYNTAX SUMMARY 913

APPENDIX F HTML SUMMARY 925

APPENDIX G TOOL SUMMARY 931

APPENDIX H JAVADOC SUMMARY 933

APPENDIX I NUMBER SYSTEMS 935

APPENDIX J BIT AND SHIFT OPERATIONS 941

APPENDIX K UML SUMMARY 943

APPENDIX L JAVA LANGUAGE CODING GUIDELINES 947

GLOSSARY 955

INDEX 969

CREDITS 1011

See More

## The Wiley Advantage

This new text finally provides the Horstmann approach for an objects-late, one, two or three term comprehensive introduction to Java. The text includes a full range of topics including GUI, Data Structures, and many others.

• Presents fundamentals first
• Takes a traditional path through the material, stressing control structures, methods, procedural decomposition, and arrays. Objects are used when appropriate in the early chapters. Students start designing and implementing their own classes in Chapter 8.
• The text includes practical, step-by-step illustrations of techniques that can help students devise and evaluation solutions to programming problems. Introduced within the chapters where they are most relevant, these strategies include: Algorithm design (with pseudocode), Flowcharts, Hand-tracing, Storyboards, Adapting Algorithms
• Screencast Videos show Cay Horstmann explaining the steps he is taking and showing his work as he solves a programming problem.
• This book contains a substantial number of self-check questions at the end of each section. Practice It and Practise makes Perfect pointers suggest exercises to try after each section, simple programming assignments, and a variety of online practice opportunities, including guided lab exercises, code completion questions, and skill-oriented multiple-choice questions provide ample opportunity for student programmers to practice what they are learning.
• A visual approach motivates and eases navigation
• Photographs present visual analogies that explain the nature and behavior of computer concepts. Step-by-step figures illustrate complex programming operations. Syntax boxes and example tables clearly present a variety of typical and special cases in a compact format. Visuals can be browsed by students prior to focusing on the textual material.
• Beginning programmers often ask "How do I start?" and "Now what do I do?" Whilst an activity as complex as programming cannot be reduced to cookbook-style instructions, step-by-step guidance is immensely helpful for building confidence and providing an outline for tasks at hand. The book contains a large number of How To guides for common tasks, together with additional worked examples and screencast videos on the web.
See More
Instructors Resources
Wiley Instructor Companion Site
Solutions to Programming Exercises
HTML and PowerPoint Slides
Test Questions
ENHANCE YOUR COURSE
A research-based online environment for learning and assessment.
Learn more
Instant access to textbooks as eTextbooks.
Learn more
Digital evaluation copy available for this title
Request Copy
Contact your Wiley Representative
Find Your Rep
See More
See Less
Students Resources
Wiley Student Companion Site
See More
See Less
Purchase Options
Wiley E-Text
Big Java: Late Objects, Interactive eBook
ISBN : 978-1-118-83882-2
1056 pages
August 2014, ©2015
\$62.50

Paperback
Big Java Late Objects 1E Mobile Access Pack
ISBN : 978-1-118-93598-9
June 2014, ©2014
\$84.95

Loose-leaf
Big Java Late Objects, Binder Ready Version
ISBN : 978-1-118-12942-5
1056 pages
February 2012, ©2013
\$104.95

Paperback
Big Java: Late Objects
ISBN : 978-1-118-08788-6
1056 pages
February 2012, ©2013
\$147.95