Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition



Similar documents
Computing Concepts with Java Essentials

Java the UML Way: Integrating Object-Oriented Design and Programming

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

Java Application Developer Certificate Program Competencies

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Java Software Structures

Android Application Development Course Program

Fundamentals of Java Programming

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Java (12 Weeks) Introduction to Java Programming Language

Java EE Web Development Course Program

AP Computer Science AB Syllabus 1

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

An Introduction to Object-Oriented Programming with

Glossary of Object Oriented Terms

Syllabus for CS 134 Java Programming

Introduction to Programming System Design. CSCI 455x (4 Units)

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

Course MS10975A Introduction to Programming. Length: 5 Days

Computer Programming I

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Morris School District. AP Computer Science A Curriculum Grades 9-12

Domains and Competencies

Charles Dierbach. Wiley

AP Computer Science Java Subset

Specialized Programme on Web Application Development using Open Source Tools

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Lewis, Loftus, and Cocking. Java Software Solutions for AP Computer Science 3rd Edition. Boston, Mass. Addison-Wesley, 2011.

Basic Programming and PC Skills: Basic Programming and PC Skills:

Computer Science III Advanced Placement G/T [AP Computer Science A] Syllabus

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

: provid.ir

Formal Engineering for Industrial Software Development

Java SE 8 Programming

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0

AP Computer Science A Syllabus

THE OPEN UNIVERSITY OF TANZANIA

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

C# Cookbook. Stephen Teilhet andjay Hilyard. O'REILLY 8 Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo '"J""'

Computer. Course Description

Course Title: Software Development

Specialized Programme on Web Application Development using Open Source Tools

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

An Introduction to Programming and Computer Science

Programming and Software Development CTAG Alignments

Morris School District. Computer Science 2 Curriculum Grades 9-12

DE 6211 DISTANCE EDUCATION. M.Sc. (IT) DEGREE EXAMINATION, MAY PRINCIPLES OF INFORMATION TECHNOLOGY. (2002 onwards) PART A (10 3 = 30 marks)

COURSE OUTLINE. Prerequisites: Course Description:

COMMUNITY COLLEGE OF CITY UNIVERSITY CITY UNIVERSITY OF HONG KONG

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

Objectif. Participant. Prérequis. Remarque. Programme. C# 3.0 Programming in the.net Framework. 1. Introduction to the.

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

BELEN JESUIT PREPARATORY SCHOOL Computer Science Department COURSE DESCRIPTIONS. And OBJECTIVES

FOR EVALUATION ONLY NOT FOR DISTRIBUTION

CS 111 Classes I 1. Software Organization View to this point:

Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

Java Interview Questions and Answers

COMPUTER SCIENCE. 1. Computer Fundamentals and Applications

Designing with Exceptions. CSE219, Computer Science III Stony Brook University

DATA STRUCTURES USING C

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

TYLER JUNIOR COLLEGE School of Continuing Studies 1530 SSW Loop 323 Tyler, TX

DIPLOMADO DE JAVA - OCA

Visual Basic. murach's TRAINING & REFERENCE

2. Advance Certificate Course in Information Technology

Some programming experience in a high-level structured programming language is recommended.

C++ Programming Language

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Programming Language Pragmatics

Android Developer Fundamental 1

Chapter 1 Fundamentals of Java Programming

Object Oriented Programming with Java. School of Computer Science University of KwaZulu-Natal

OKLAHOMA SUBJECT AREA TESTS (OSAT )

JAVA COLLECTIONS FRAMEWORK

Skills for Employment Investment Project (SEIP)

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Java Programming Language

Japan Communication India Skill Development Center

Curriculum Map. Discipline: Computer Science Course: C++

Department of Computer Science

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Java SE 7 Programming

Habanero Extreme Scale Software Research Project

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

10 Java API, Exceptions, and Collections

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011

Programming and Software Development (PSD)

BCS2B02: OOP Concepts and Data Structures Using C++

William Paterson University of New Jersey Department of Computer Science College of Science and Health Course Outline

Japan Communication India Skill Development Center

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department

BCA 421- Java. Tilak Maharashtra University. Bachelor of Computer Applications (BCA) 1. The Genesis of Java

Summit Public Schools Summit, New Jersey Grade Level / Content Area: Mathematics Length of Course: 1 Academic Year Curriculum: AP Computer Science A

Transcription:

Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION

CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating Human-Readable Programs to Machine Code 7 1.4 The Java Programming Language 8 1.5 The Structure of a Simple Program 10 1.6 Compiling and Running a Java Program 14 1.7 Errors 17 1.8 Algorithms 19 chapter 2 AN INTRODUCTION TO OBJECTS AND CLASSES 2.1 Objects, Classes, and Methods 32 2.2 Declaring Variables 34 2.3 Constructing Objects 38 2.4 The API Documentation 40 2.5T Implementing a Test Program 43 2.6 Instance Variables 45 2.7 Specifying the Public Interface of a Class 48 2.8 Providing the Class Implementation 52 2.9T Unit Testing 58 2.10 Local Variables 60 2.11 Object References 62 2.12 Implicit Parameters 65 2.1 3G Graphical Applications and Frame Windows 67 2.14G Drawing on a Component 68 2.1 5G Ellipses, Lines, Text, and Color 72 2.16G Shape Classes 76

xxii Contents chapter 3 FUNDAMENTAL DATATYPES 99 3.1 Number Types 100 3.2 Constants 102 3.3 Arithmetic Operations and Mathematical Functions 107 3.4 Calling Static Methods 115 3.5 Strings 118 3.6 Reading Input 122 CHAPTER 4 DECISIONS 135 4.1 The if Statement 136 4.2 Comparing Values 140 4.3 Multiple Alternatives 149 4.4 Using Boolean Expressions 157 4.5T Code Coverage 162 chapters ITERATION 177 5.1 while Loops 178 5.2 for Loops 185 5.3 Common Loop Algorithms 194 5.4 Nested Loops 202 5.5 Application: Random Numbers and Simulations 205 5.6T Using a Debugger 207 chapter6 ARRAYS AND ARRAY LISTS 225 6.1 Arrays 226 6.2 Array Lists 232 6.3 Wrappers and Auto-boxing 238 6.4 The Enhanced for Loop 239 6.5 Partially Filled Arrays 241 6.6 Common Array Algorithms 243 6.7T Regression Testing 255 6.8 Two-Dimensional Arrays 258

Contents xxiii chapter 7 DESIGNING CLASSES 273 7.1 Discovering Classes 274 7.2 Cohesion and Coupling 275 7.3 Immutable Classes 278 7.4 Side Effects 279 7.5 Preconditions and Postconditions 283 7.6 Static Methods 286 7.7 Static Variables 288 7.8 Scope 291 7.9 Packages 294 7.10T Unit Test Frameworks 300 chapter s INTERFACES AND POLYMORPHISM 31 3 8.1 Using Interfaces for Algorithm Reuse 314 8.2 Converting Between Class and Interface Types 320 8.3 Polymorphism 322 8.4 Using Interfaces for Callbacks 323 8.5 Inner Classes 327 8.6T Mock Objects 329 8.7G Events, Event Sources, and Event Listeners 331 8.8G Using Inner Classes for Listeners 334 8.9G Building Applications with Buttons 336 8.10G Processing Timer Events 8.11 C Mouse Events chapter 9 INHERITANCE 351 9.1 Inheritance Hierarchies 352 9.2 Implementing Subclasses 355 9.3 Overriding Methods 359 9.4 Subclass Construction 362 9.5 Converting Between Subclass and Superclass Types 365 9.6 Polymorphism and Inheritance 367 9.7 Object: The Cosmic Superclass 375 9.8G Using Inheritance to Customize Frames 381

xxiv Contents chapter 10 INPUT/OUTPUT AND EXCEPTION HANDLING 391 10.1 Reading and Writing Text Files 392 10.2 Reading Text Input 395 10.3 Throwing Exceptions 403 10.4 Checked and Unchecked Exceptions 405 10.5 Catching Exceptions 407 10.6 The finally Clause 410 10.7 Designing Your Own Exception Types 412 10.8 Case Study. A Complete Example 413 chapter n OBJECT-ORIENTED DESIGN 425 11.1 The Software Life Cycle 426 11.2 Discovering Classes 430 11.3 Relationships Between Classes 433 11.4 Case Study: Printing an Invoice 436 11.5 Case Study: An Automatic Teller Machine 447 chapter 12 RECURSION 475 12.1 Triangle Numbers 476 12.2 Recursive Helper Methods 484 12.3 The Efficiency of Recursion 486 12.4 Permutations 491 12.5 Mutual Recursions 494 chapter 13 SORTING AND SEARCHING 509 13.1 Selection Sort 510 13.2 Profiling the Selection Sort Algorithm 513 13.3 Analyzing the Performance of the Selection Sort Algorithm 516 13.4 Merge Sort 518 13.5 Analyzing the Merge Sort Algorithm 521 13.6 Searching 524 13.7 Binary Search 526 13.8 Sorting Real Data 529

Contents xxv chapters AN INTRODUCTION TO DATA STRUCTURES 539 14.1 Using Linked Lists 540 14.2 Implementing Linked Lists 545 14.3 Abstract Data Types 556 14.4 Stacks and Queues 559 JffliSEIfJ 15.1 Sets 15.2 Maps 15.3 Hash Tables 15.4 Computing Hash Codes 15.5 Binary Search Trees 15.6 Binary Tree Traversal 15.7 Priority Queues ^QMSfiLtAB^M;. 15.8 Heaps 15.9 The Heapsort Algorithm pterla GENERIC PROGRAMMING 16.1 Generic Classes and Type Parameters 16.2 Implementing Generic Types 16.3 Generic Methods 16.4 Constraining Type Parameters 1 6.5 Type Erasure O aj^ta^e^^ 17.1G Processing Text Input 17.2G Text Areas 17.3G Layout Management 17.4G Choices 17.5G Menus 17.6G Exploring the Swing Documentation Available online in WileyPLUS and at www.wiley.com/go/global/horstmann.

xxvi Contents APPENDICES APPENDIX A THE BASIC LATIN AND LATIN-1 SUBSETS OF UNICODE 573 APPENDIX B JAVA OPERATOR SUMMARY 577 APPENDIX C JAVA RESERVED WORD SUMMARY 579 APPENDIX D THE JAVA LIBRARY 581 APPENDIX E JAVA SYNTAX SUMMARY APPENDIX F HTML SUMMARY APPENDIX C TOOL SUMMARY APPENDIX H JAVADOC SUMMARY APPENDIX I NUMBER SYSTEMS APPENDIXJ BIT AND SHIFT OPERATIONS APPENDIX K UML SUMMARY APPENDIX L JAVA LANGUAGE CODING GUIDELINES GLOSSARY 613 INDEX 627 ILLUSTRATION CREDITS 649