Big Java
Early Objects, EMEA Edition
Häftad, Engelska, 2019
Av Cay S. Horstmann, Cay S. (San Jose State University) Horstmann
729 kr
Beställningsvara. Skickas inom 7-10 vardagar
Fri frakt för medlemmar vid köp för minst 249 kr.Big Java: Early Objects, 7e focuses on the essentials of effective learning and is suitable for a two-semester introduction to programming sequence. The text requires no prior programming experience and only a modest amount of high school algebra. Objects and classes from the standard library are used where appropriate in early sections with coverage on object oriented design starting in Chapter 8. This gradual approach allows students to use objects throughout their study of the core algorithmic topics, without teaching bad habits that must be un-learned later. The second half covers algorithms and data structures at a level suitable for beginning students.
Produktinformation
- Utgivningsdatum2019-05-14
- Mått10 x 10 x 10 mm
- Vikt454 g
- FormatHäftad
- SpråkEngelska
- Antal sidor1 024
- Upplaga7
- FörlagJohn Wiley & Sons Inc
- ISBN9781119588887
Tillhör följande kategorier
- Preface iiiSpecial Features xxiv1 Introduction 11.1 Computer Programs 21.2 The Anatomy of a Computer 31.3 The Java Programming Language 51.4 Becoming Familiar with Your Programming Environment 71.5 Analyzing Your First Program 111.6 Errors 131.7 PROBLEM SOLVING Algorithm Design 15The Algorithm Concept 15An Algorithm for Solving an Investment Problem 16Pseudocode 17From Algorithms to Programs 182 Using Objects 232.1 Objects and Classes 24Using Objects 24Classes 252.2 Variables 26Variable Declarations 26Types 28Names 29Comments 30Assignment 302.3 Calling Methods 33The Public Interface of a Class 33Method Arguments 34Return Values 35Method Declarations 362.4 Constructing Objects 382.5 Accessor and Mutator Methods 402.6 The API Documentation 41Browsing the API Documentation 41Packages 432.7 Implementing a Test Program 442.8 Object References 462.9 Graphical Applications 49Frame Windows 50Drawing on a Component 51Displaying a Component in a Frame 532.10 Ellipses, Lines, Text, and Color 54Ellipses and Circles 54Lines 55Drawing Text 56Colors 563 Implementing Classes 613.1 Instance Variables and Encapsulation 62Instance Variables 62The Methods of the Counter Class 64Encapsulation 643.2 Specifying the Public Interface of a Class 66Specifying Methods 66Specifying Constructors 67Using the Public Interface 69Commenting the Public Interface 693.3 Providing the Class Implementation 72Providing Instance Variables 72Providing Constructors 73Providing Methods 753.4 Unit Testing 813.5 PROBLEM SOLVING Tracing Objects 843.6 Local Variables 863.7 The this Reference 883.8 Shape Classes 904 Fundamental Data Types 994.1 Numbers 100Number Types 100Constants 1024.2 Arithmetic 107Arithmetic Operators 107Increment and Decrement 107Integer Division and Remainder 108Powers and Roots 109Converting Floating-Point Numbers to Integers 1104.3 Input and Output 114Reading Input 114Formatted Output 1154.4 PROBLEM SOLVING First Do it By Hand 1214.5 Strings 122The String Type 122Concatenation 123String Input 124Escape Sequences 124Strings and Characters 124Substrings 1255 Decisions 1315.1 The if Statement 1325.2 Comparing Values 137Relational Operators 138Comparing Floating-Point Numbers 139Comparing Strings 140Comparing Objects 141Testing for null 1415.3 Multiple Alternatives 1465.4 Nested Branches 1495.5 PROBLEM SOLVING Flowcharts 1565.6 PROBLEM SOLVING Selecting Test Cases 1595.7 Boolean Variables and Operators 161Operators 1655.8 APPLICATION Input Validation 1666 Loops 1716.1 The while Loop 1726.2 PROBLEM SOLVING Hand-Tracing 1796.3 The for Loop 183Header 1896.4 The do Loop 1906.5 APPLICATION Processing Sentinel Values 1926.6 PROBLEM SOLVING Storyboards 1976.7 Common Loop Algorithms 199Sum and Average Value 199Counting Matches 200Finding the First Match 200Prompting Until a Match is Found 201Maximum and Minimum 201Comparing Adjacent Values 2026.8 Nested Loops 2066.9 APPLICATION Random Numbers and Simulations 209Generating Random Numbers 210The Monte Carlo Method 2116.10 Using a Debugger 2137 Arrays and Array Lists 2217.1 Arrays 222Declaring and Using Arrays 222Array References 225Using Arrays with Methods 226Partially Filled Arrays 226Arguments 2297.2 The Enhanced for Loop 2307.3 Common Array Algorithms 232Filling 232Sum and Average Value 232Maximum and Minimum 232Element Separators 232Linear Search 233Removing an Element 234Inserting an Element 234Swapping Elements 236Copying Arrays 237Reading Input 2387.4 PROBLEM SOLVING Adapting Algorithms 2407.5 PROBLEM SOLVING Discovering Algorithms by Manipulating Physical Objects 2457.6 Two-Dimensional Arrays 248Declaring Two-Dimensional Arrays 248Accessing Elements 249Locating Neighboring Elements 250Accessing Rows and Columns 251Two-Dimensional Array Parameters 2527.7 Array Lists 255Declaring and Using Array Lists 255Using the Enhanced for Loop with Array Lists 258Copying Array Lists 259Wrappers and Auto-boxing 259Using Array Algorithms with Array Lists 260Storing Input Values in an Array List 261Removing Matches 261Choosing Between Array Lists and Arrays 2627.8 Regression Testing 2648 Designing Classes 2718.1 Discovering Classes 2728.2 Designing Good Methods 273Providing a Cohesive Public Interface 273Minimizing Dependencies 274Separating Accessors and Mutators 275Minimizing Side Effects 2768.3 PROBLEM SOLVING Patterns for Object Data 282Keeping a Total 282Counting Events 283Collecting Values 283Managing Properties of an Object 284Modeling Objects with Distinct States 284Describing the Position of an Object 2858.4 Static Variables and Methods 2868.5 PROBLEM SOLVING Solve a Simpler Problem First 2918.6 Packages 295Organizing Related Classes into Packages 295Importing Packages 296Package Names 297Packages and Source Files 2978.7 Unit Test Frameworks 3009 Inheritance 3059.1 Inheritance Hierarchies 3069.2 Implementing Subclasses 3109.3 Overriding Methods 3149.4 Polymorphism 3199.5 Object: The Cosmic Superclass 330Overriding the toString Method 330The equals Method 332The instanceof Operator 33310 Interfaces 33910.1 Using Interfaces for Algorithm Reuse 340Discovering an Interface Type 340Declaring an Interface Type 341Implementing an Interface Type 343Comparing Interfaces and Inheritance 34510.2 Working with Interface Variables 348Converting from Classes to Interfaces 348Invoking Methods on Interface Variables 349Casting from Interfaces to Classes 34910.3 The Comparable Interface 350Interface 35210.4 Using Interfaces for Callbacks 35510.5 Inner Classes 36010.6 Mock Objects 36110.7 Event Handling 363Listening to Events 363Using Inner Classes for Listeners 36510.8 Building Applications with Buttons 36810.9 Processing Timer Events 37110.10 Mouse Events 37411 Input/Output and Exception Handling 38311.1 Reading and Writing Text Files 38411.2 Text Input and Output 389Reading Words 389Reading Characters 390Classifying Characters 390Reading Lines 390Scanning a String 392Converting Strings to Numbers 392Avoiding Errors When Reading Numbers 392Mixing Number, Word, and Line Input 393Formatting Output 39411.3 Command Line Arguments 39611.4 Exception Handling 403Throwing Exceptions 403Catching Exceptions 405Checked Exceptions 407Closing Resources 409Designing Your Own Exception Types 41011.5 APPLICATION Handling Input Errors 41212 Object-Oriented Design 41912.1 Classes and Their Responsibilities 420Discovering Classes 420The CRC Card Method 42112.2 Relationships Between Classes 423Dependency 423Aggregation 424Inheritance 42512.3 APPLICATION Printing an Invoice 428Requirements 429CRC Cards 429UML Diagrams 432Method Documentation 432Implementation 43413 Recursion 44313.1 Triangle Numbers 44413.2 Recursive Helper Methods 45213.3 The Efficiency of Recursion 45313.4 Permutations 45913.5 Mutual Recursion 46313.6 Backtracking 46914 Sorting and Searching 47714.1 Selection Sort 47814.2 Profiling the Selection Sort Algorithm 48114.3 Analyzing the Performance of the Selection Sort Algorithm 48414.4 Merge Sort 48814.5 Analyzing the Merge Sort Algorithm 49114.6 Searching 495Linear Search 495Binary Search 49714.7 PROBLEM SOLVING Estimating the Running Time of an Algorithm 500Linear Time 500Quadratic Time 501The Triangle Pattern 502Logarithmic Time 50314.8 Sorting and Searching in the Java Library 504Sorting 504Binary Search 505Comparing Objects 50515 The Java Collections Framework 51115.1 An Overview of the Collections Framework 51215.2 Linked Lists 514The Structure of Linked Lists 515The LinkedList Class of the Java Collections Framework 516List Iterators 51615.3 Sets 520Choosing a Set Implementation 520Working with Sets 52215.4 Maps 52515.5 Stacks, Queues, and Priority Queues 531Stacks 531Queues 532Priority Queues 53315.6 Stack and Queue Applications 534Balancing Parentheses 534Evaluating Reverse Polish Expressions 535Evaluating Algebraic Expressions 537Backtracking 540Customers 54316 Basic Data Structures 54516.1 Implementing Linked Lists 546The Node Class 546Adding and Removing the First Element 547The Iterator Class 548Advancing an Iterator 549Removing an Element 550Adding an Element 552Setting an Element to a Different Value 553Efficiency of Linked List Operations 55316.2 Implementing Array Lists 560Getting and Setting Elements 560Removing or Adding Elements 562Growing the Internal Array 56316.3 Implementing Stacks and Queues 564Stacks as Linked Lists 565Stacks as Arrays 566Queues as Linked Lists 567Queues as Circular Arrays 56816.4 Implementing a Hash Table 570Hash Codes 570Hash Tables 570Finding an Element 572Adding and Removing Elements 572Iterating over a Hash Table 57317 Tree Structures 58117.1 Basic Tree Concepts 58217.2 Binary Trees 585Binary Tree Examples 586Balanced Trees 588A Binary Tree Implementation 58917.3 Binary Search Trees 590The Binary Search Property 591Insertion 592Removal 594Efficiency of the Operations 59517.4 Tree Traversal 599Inorder Traversal 599Preorder and Postorder Traversals 601The Visitor Pattern 602Depth-First and Breadth-First Search 603Tree Iterators 60417.5 Red-Black Trees 605Basic Properties of Red-Black Trees 605Insertion 607Removal 60817.6 Heaps 61217.7 The Heapsort Algorithm 62218 Generic Classes 62918.1 Generic Classes and Type Parameters 63018.2 Implementing Generic Types 63118.3 Generic Methods 63418.4 Constraining Type Parameters 63618.5 Type Erasure 63919 Stream Processing 64519.1 The Stream Concept 64619.2 Producing Streams 64819.3 Collecting Results 64919.4 Transforming Streams 65219.5 Lambda Expressions 65419.6 The Optional Type 65919.7 Other Terminal Operations 66119.8 Primitive-Type Streams 663Creating Primitive-Type Streams 663Mapping a Primitive-Type Stream 663Processing Primitive-Type Streams 66419.9 Grouping Results 66519.10 Common Algorithms Revisited 667Filling 667Sum, Average, Maximum, and Minimum 668Counting Matches 668Element Separators 668Linear Search 669Comparing Adjacent Values 66920 Graphical User Interfaces 67520.1 Layout Management 676Using Layout Managers 676Achieving Complex Layouts 677Using Inheritance to Customize Frames 67820.2 Processing Text Input 680Text Fields 680Text Areas 68220.3 Choices 685Radio Buttons 685Check Boxes 687Combo Boxes 68720.4 Menus 69520.5 Exploring the Swing Documentation 70221 Advanced Input/Output* (Etext Only)21.1 Readers, Writers, and Input/Output Streams21.2 Binary Input and Output21.3 Random Access21.4 Object Input and Output Streams21.5 File and Directory Operations PathsCreating and Deleting Files and DirectoriesUseful File OperationsVisiting Directories22 Multithreading* (Etext Only)22.1 Running Threads22.2 Terminating Threads22.3 Race Conditions22.4 Synchronizing Object Access22.5 Avoiding Deadlocks22.6 APPLICATION Algorithm Animation23 Internet Networking* (Etext Only)23.1 The Internet Protocol23.2 Application Level Protocols23.3 A Client Program23.4 A Server Program23.5 URL Connections24 Relational Databases* (Etext Only)24.1 Organizing Database InformationDatabase TablesLinking TablesImplementing Multi-Valued Relationships24.2 QueriesSimple QueriesSelecting ColumnsSelecting SubsetsCalculationsJoinsUpdating and Deleting Data24.3 Installing a Database24.4 Database Programming in JavaConnecting to the DatabaseExecuting SQL StatementsAnalyzing Query ResultsResult Set Metadata24.5 APPLICATION Entering an Invoice25 XML* (Etext Only)25.1 XML Tags and DocumentsAdvantages of XMLDifferences Between XML and HTMLThe Structure of an XML Document25.2 Parsing XML Documents25.3 Creating XML Documents25.4 Validating XML DocumentsDocument Type DefinitionsSpecifying a DTD in an XML DocumentParsing and ValidationAppendix A The Basic Latin and Latin-1 Subsets of Unicode A-1Appendix B JAVA Operator Summary A-5Appendix C JAVA Reserved Word Summary A-7Appendix D The Java Library A-9Appendix E JAVA Language Coding Guidelines A-38Appendix F Tool Summary (Etext Only)Appendix G Number Systems (Etext Only)Appendix H UML Summary (Etext Only)Appendix I JAVA Syntax Summary (Etext Only)Appendix J Html Summary (Etext Only)Glossary G-1Index I-1Credits C-1Quick Reference C-3