Produktinformation
- Utgivningsdatum2017-12-27
- Mått180 x 230 x 32 mm
- Vikt1 260 g
- FormatHäftad
- SpråkEngelska
- Upplaga4
- FörlagPearson Education (US)
- ISBN9780134777566
Tillhör följande kategorier
Paul Deitel, CEO and Chief Technical Officer of Deitel & Associates, Inc., is a graduate of MIT, where he studied Information Technology. Through Deitel & Associates, Inc., he has delivered hundreds of programming courses worldwide to clients, including Cisco, IBM, Siemens, Sun Microsystems, Dell, Fidelity, NASA at the Kennedy Space Center, the National Severe Storm Laboratory, White Sands Missile Range, Rogue Wave Software, Boeing, SunGard Higher Education, Nortel Networks, Puma, iRobot, Invensys and many more. He and his co-author, Dr. Harvey M. Deitel, are the world’s best-selling programming-language textbook/professional book/video authors.Dr. Harvey Deitel, Chairman and Chief Strategy Officer of Deitel & Associates, Inc., has over 50 years of experience in the computer field. Dr. Deitel earned B.S. and M.S. degrees in Electrical Engineering from MIT and a Ph.D. in Mathematics from Boston University. He has extensive college teaching experience, including earning tenure and serving as the Chairman of the Computer Science Department at Boston College before founding Deitel & Associates, Inc., in 1991 with his son, Paul. The Deitels’ publications have earned international recognition, with translations published in Japanese, German, Russian, Spanish, French, Polish, Italian, Simplified Chinese, Traditional Chinese, Korean, Portuguese, Greek, Urdu and Turkish. Dr. Deitel has delivered hundreds of programming courses to corporate, academic, government and military clients.
- Foreword xxviiPreface xxixBefore You Begin xlvChapter 1: Introduction and Test-Driving a Java Application 11.1 Introduction 21.2 Object Technology Concepts 31.3 Java 61.4 A Typical Java Development Environment 81.5 Test-Driving a Java Application 111.6 Software Technologies 151.7 Getting Your Questions Answered 18Chapter 2: Introduction to Java Applications; Input/Output and Operators 192.1 Introduction 202.2 Your First Program in Java: Printing a Line of Text 202.3 Modifying Your First Java Program 242.4 Displaying Text with printf 262.5 Another Application: Adding Integers 272.6 Arithmetic 302.7 Decision Making: Equality and Relational Operators 312.8 Wrap-Up 34Chapter 3: Introduction to Classes, Objects, Methods and Strings 353.1 Introduction 363.2 Instance Variables, set Methods and get Methods 373.3 Account Class: Initializing Objects with Constructors 463.4 Account Class with a Balance; Floating-Point Numbers 493.5 Primitive Types vs. Reference Types 543.6 Wrap-Up 55Chapter 4: Control Statements: Part 1; Assignment, ++ and -- Operators 564.1 Introduction 574.2 Control Structures 574.3 if Single-Selection Statement 594.4 if...else Double-Selection Statement 604.5 while Iteration Statement 634.6 Counter-Controlled Iteration 654.7 Sentinel-Controlled Iteration 684.8 Nesting Different Control Statements 724.9 Compound Assignment Operators 744.10 Increment and Decrement Operators 754.11 Primitive Types 784.12 Wrap-Up 78Chapter 5: Control Statements: Part 2; Logical Operators 795.1 Introduction 805.2 Essentials of Counter-Controlled Iteration 805.3 for Iteration Statement 815.4 Examples Using the for Statement 855.5 do...while Iteration Statement 905.6 switch Multiple-Selection Statement 905.7 Class AutoPolicy: Strings in switch Statements 975.8 break and continue Statements 1005.9 Logical Operators 1025.10 Wrap-Up 108Chapter 6: Methods: A Deeper Look 1096.1 Introduction 1106.2 Program Units in Java 1106.3 static Methods, static Fields and Class Math 1116.4 Methods with Multiple Parameters 1136.5 Notes on Declaring and Using Methods 1166.6 Argument Promotion and Casting 1176.7 Java API Packages 1196.8 Case Study: Secure Random-Number Generation 1206.9 Case Study: A Game of Chance; Introducing enum Types 1256.10 Scope of Declarations 1296.11 Method Overloading 1326.12 Wrap-Up 134Chapter 7: Arrays and ArrayLists 1357.1 Introduction 1367.2 Arrays 1377.3 Declaring and Creating Arrays 1387.4 Examples Using Arrays 1397.5 Exception Handling: Processing the Incorrect Response 1487.6 Case Study: Card Shuffling and Dealing Simulation 1497.7 Enhanced for Statement 1537.8 Passing Arrays to Methods 1557.9 Pass-By-Value vs. Pass-By-Reference 1577.10 Case Study: Class GradeBook Using an Array to Store Grades 1587.11 Multidimensional Arrays 1637.12 Case Study: Class GradeBook Using a Two-Dimensional Array 1677.13 Variable-Length Argument Lists 1737.14 Using Command-Line Arguments 1747.15 Class Arrays 1767.16 Introduction to Collections and Class ArrayList 1797.17 Wrap-Up 182Chapter 8: Classes and Objects: A Deeper Look 1848.1 Introduction 1858.2 Time Class Case Study 1858.3 Controlling Access to Members 1908.4 Referring to the Current Object’s Members with the this Reference 1918.5 Time Class Case Study: Overloaded Constructors 1938.6 Default and No-Argument Constructors 1988.7 Notes on Set and Get Methods 1998.8 Composition 2008.9 enum Types 2038.10 Garbage Collection 2068.11 static Class Members 2068.12 static Import 2108.13 final Instance Variables 2118.14 Package Access 2128.15 Using BigDecimal for Precise Monetary Calculations 2138.16 JavaMoney API 2168.17 Time Class Case Study: Creating Packages 2168.18 Wrap-Up 220Chapter 9: Object-Oriented Programming: Inheritance 2219.1 Introduction 2229.2 Superclasses and Subclasses 2239.3 protected Members 2259.4 Relationship Between Superclasses and Subclasses 2269.5 Constructors in Subclasses 2469.6 Class Object 2479.7 Designing with Composition vs. Inheritance 2489.8 Wrap-Up 249Chapter 10: Object-Oriented Programming: Polymorphism and Interfaces 25110.1 Introduction 25210.2 Polymorphism Examples 25410.3 Demonstrating Polymorphic Behavior 25510.4 Abstract Classes and Methods 25710.5 Case Study: Payroll System Using Polymorphism 26010.6 Allowed Assignments Between Superclass and Subclass Variables 27410.7 final Methods and Classes 27410.8 A Deeper Explanation of Issues with Calling Methods from Constructors 27510.9 Creating and Using Interfaces 27610.10 Java SE 8 Interface Enhancements 28510.11 Java SE 9 private Interface Methods 28710.12 private Constructors 28710.13 Program to an Interface, Not an Implementation 28810.14 Wrap-Up 290Chapter 11: Exception Handling: A Deeper Look 29111.1 Introduction 29211.2 Example: Divide by Zero without Exception Handling 29311.3 Example: Handling ArithmeticExceptions and InputMismatchExceptions 29511.4 When to Use Exception Handling 30011.5 Java Exception Hierarchy 30111.6 finally Block 30411.7 Stack Unwinding and Obtaining Information from an Exception 30911.8 Chained Exceptions 31111.9 Declaring New Exception Types 31311.10 Preconditions and Postconditions 31411.11 Assertions 31511.12 try-with-Resources: Automatic Resource Deallocation 31711.13 Wrap-Up 318Chapter 12: JavaFX Graphical User Interfaces: Part 1 31912.1 Introduction 32012.2 JavaFX Scene Builder 32112.3 JavaFX App Window Structure 32212.4 Welcome App—Displaying Text and an Image 32312.5 Tip Calculator App—Introduction to Event Handling 32812.6 Features Covered in the Other JavaFX Chapters 34612.7 Wrap-Up 346Chapter 13: JavaFX GUI: Part 2 34713.1 Introduction 34813.2 Laying Out Nodes in a Scene Graph 34813.3 Painter App: RadioButtons, Mouse Events and Shapes 35013.4 Color Chooser App: Property Bindings and Property Listeners 36013.5 Cover Viewer App: Data-Driven GUIs with JavaFX Collections 36613.6 Cover Viewer App: Customizing ListView Cells 37113.7 Additional JavaFX Capabilities 37513.8 JavaFX 9: Java SE 9 JavaFX Updates 37713.9 Wrap-Up 379Chapter 14: Strings, Characters and Regular Expressions 38014.1 Introduction 38114.2 Fundamentals of Characters and Strings 38114.3 Class String 38214.4 Class StringBuilder 39514.5 Class Character 40214.6 Tokenizing Strings 40714.7 Regular Expressions, Class Pattern and Class Matcher 40814.8 Wrap-Up 417Chapter 15: Files, Input/Output Streams, NIO and XML Serialization 41815.1 Introduction 41915.2 Files and Streams 41915.3 Using NIO Classes and Interfaces to Get File and Directory Information 42115.4 Sequential Text Files 42515.5 XML Serialization 43415.6 FileChooser and DirectoryChooser Dialogs 44115.7 (Optional) Additional java.io Classes 44715.8 Wrap-Up 450Chapter 16: Generic Collections 45116.1 Introduction 45216.2 Collections Overview 45216.3 Type-Wrapper Classes 45416.4 Autoboxing and Auto-Unboxing 45416.5 Interface Collection and Class Collections 45416.6 Lists 45516.7 Collections Methods 46316.8 Class PriorityQueue and Interface Queue 47416.9 Sets 47516.10 Maps 47816.11 Synchronized Collections 48216.12 Unmodifiable Collections 48216.13 Abstract Implementations 48316.14 Java SE 9: Convenience Factory Methods for Immutable Collections 48316.15 Wrap-Up 487Chapter 17: Lambdas and Streams 48817.1 Introduction 48917.2 Streams and Reduction 49117.3 Mapping and Lambdas 49417.4 Filtering 49817.5 How Elements Move Through Stream Pipelines 50017.6 Method References 50117.7 IntStream Operations 50417.8 Functional Interfaces 50917.9 Lambdas: A Deeper Look 51017.10 Stream Manipulations 51117.11 Stream Manipulations 51417.12 Stream Manipulations 51717.13 Creating a Stream from a File 52817.14 Streams of Random Values 53117.15 Infinite Streams 53317.16 Lambda Event Handlers 53517.17 Additional Notes on Java SE 8 Interfaces 53517.18 Wrap-Up 536Chapter 18: Recursion 53718.1 Introduction 53818.2 Recursion Concepts 53818.3 Example Using Recursion: Factorials 53918.4 Reimplementing Class FactorialCalculator Using BigInteger 54118.5 Example Using Recursion: Fibonacci Series 54318.6 Recursion and the Method-Call Stack 54618.7 Recursion vs. Iteration 54718.8 Towers of Hanoi 54918.9 Fractals 55118.10 Recursive Backtracking 56118.11 Wrap-Up 562Chapter 19: Generic Classes and Methods: A Deeper Look 56319.1 Introduction 56419.2 Motivation for Generic Methods 56419.3 Generic Methods: Implementation and Compile-Time Translation 56619.4 Additional Compile-Time Translation Issues: Methods That Use a Type Parameter as the Return Type 56919.5 Overloading Generic Methods 57219.6 Generic Classes 57319.7 Wildcards in Methods That Accept Type Parameters 58019.8 Wrap-Up 584Chapter 20: JavaFX Graphics, Animation and Video 58520.1 Introduction 58620.2 Controlling Fonts with Cascading Style Sheets (CSS) 58720.3 Displaying Two-Dimensional Shapes 59420.4 Polylines, Polygons and Paths 59920.5 Transforms 60420.6 Playing Video with Media, MediaPlayer and MediaViewer 60620.7 Transition Animations 61220.8 Timeline Animations 61820.9 Frame-by-Frame Animation with AnimationTimer 62120.10 Drawing on a Canvas 62420.11 Three-Dimensional Shapes 62820.12 Wrap-Up 632Chapter 21: Concurrency and Multi-Core Performance 63421.1 Introduction 63521.2 Thread States and Life Cycle 63721.3 Creating and Executing Threads with the Executor Framework 64021.4 Thread Synchronization 64421.5 Producer/Consumer Relationship without Synchronization 65321.6 Producer/Consumer Relationship: ArrayBlockingQueue 66121.7 (Advanced) Producer/Consumer Relationship with synchronized, wait, notify and notifyAll 66421.8 (Advanced) Producer/Consumer Relationship: Bounded Buffers 67021.9 (Advanced) Producer/Consumer Relationship: The Lock and Condition Interfaces 67821.10 Concurrent Collections 68521.11 Multithreading in JavaFX 68721.12 sort/parallelSort Timings with the Java SE 8 Date/Time API 69921.13 Java SE 8: Sequential vs. Parallel Streams 70221.14 (Advanced) Interfaces Callable and Future 70421.15 (Advanced) Fork/Join Framework 70921.16 Wrap-Up 709Chapter 22: Accessing Databases with JDBC 71122.1 Introduction 71222.2 Relational Databases 71322.3 A books Database 71422.4 SQL 71822.5 Setting Up a Java DB Database 72722.6 Connecting to and Querying a Database 72922.7 Querying the books Database 73422.8 RowSet Interface 74622.9 PreparedStatements 74922.10 Stored Procedures 76122.11 Transaction Processing 76122.12 Wrap-Up 762Chapter 23: Introduction to JShell: Java 9’s REPL for Interactive Java 76323.1 Introduction 76423.2 Installing JDK 9 76623.3 Introduction to JShell 76623.4 Command-Line Input in JShell 77723.5 Declaring and Using Classes 77823.6 Discovery with JShell Auto-Completion 78223.7 Exploring a Class’s Members and Viewing Documentation 78423.8 Declaring Methods 79023.9 Exceptions 79223.10 Importing Classes and Adding Packages to the CLASSPATH 79323.11 Using an External Editor 79523.12 Summary of JShell Commands 79723.13 Keyboard Shortcuts for Snippet Editing 80323.14 How JShell Reinterprets Java for Interactive Use 80323.15 IDE JShell Support 80423.16 Wrap-Up 804Chapter 24: Java Persistence API (JPA) 82024.1 Introduction 82124.2 JPA Technology Overview 82224.3 Querying a Database with JPA 82324.4 Named Queries; Accessing Data from Multiple Tables 83024.5 Address Book: Using JPA and Transactions to Modify a Database 83524.6 Web Resources 84324.7 Wrap-Up 844Chapter 25: ATM Case Study, Part 1: Object-Oriented Design with the UML 84525.1 Case Study Introduction 84625.2 Examining the Requirements Document 84625.3 Identifying the Classes in a Requirements Document 85425.4 Identifying Class Attributes 86025.5 Identifying Objects’ States and Activities 86525.6 Identifying Class Operations 86825.7 Indicating Collaboration Among Objects 87525.8 Wrap-Up 882Chapter 26: ATM Case Study Part 2: Implementing an Object-Oriented Design 88626.1 Introduction 88726.2 Starting to Program the Classes of the ATM System 88726.3 Incorporating Inheritance and Polymorphism into the ATM System 89226.4 ATM Case Study Implementation 89826.5 Wrap-Up 921Chapter 27: Java Platform Module System 92327.1 Introduction 92427.2 Module Declarations 92927.3 Modularized Welcome App 93227.4 Creating and Using a Custom Module 94227.5 Module-Dependency Graphs: A Deeper Look 94827.6 Migrating Code to Java 9 95127.7 Resources in Modules; Using an Automatic Module 95527.8 Creating Custom Runtimes with jlink 95927.9 Services and ServiceLoader 96327.10 Wrap-Up 973Chapter 28: Additional Java 9 Topics 97528.1 Introduction 97628.2 Recap: Java 9 Features Covered in Earlier Chapters 97728.3 New Version String Format 97728.4 Regular Expressions: New Matcher Class Methods 97828.5 New Stream Interface Methods 98028.6 Modules in JShell 98328.7 JavaFX 9 Skin APIs 98428.8 Other GUI and Graphics Enhancements 98528.9 Security Related Java 9 Topics 98628.10 Other Java 9 Topics 98728.11 Items Removed from the JDK and Java 9 99028.12 Items Proposed for Removal from Future Java Versions 99128.13 Wrap-Up 992Appendix A: Operator Precedence Chart 994Appendix B: ASCII Character Set 996Appendix C: Keywords and Reserved Words 997Appendix D: Primitive Types 998Appendix E: Bit Manipulation 999E.1 Introduction 999E.2 Bit Manipulation and the Bitwise Operators 999E.3 BitSet Class 1009Appendix F: Labeled break and continue Statements 1012F.1 Introduction 1012F.2 Labeled break Statement 1012F.3 Labeled continue Statement 1013Index 1015
“Content is expertly covered. Java 9 introduces modules—a major shake-up to the Java ecosystem that brings numerous benefits, but also new challenges, terminology and patterns. Developers moving to Java 9 must know how to interact with modules, and this book does an expert job at clearly introducing these concepts. The book also covers numerous other Java 8 and Java 9 features, such as JShell, lambda expressions and JavaFX improvements. With this knowledge, developers can realize massive productivity gains by benefiting from the state of the art in Java. I highly recommend this book to all professionals aiming to keep current with the very latest Java developments.”—Jonathan Giles, Consulting Member of Technical Staff, Oracle “Provides a thorough introduction to the JShell tool for discovery. Java 9 for Programmers takes full advantage of that with interesting exercises.”—Robert Field, JShell Architect, Oracle “Covers JavaFX functionality that makes it easy to create nice, active user interfaces. A great overview on how concurrency can help developers leverage multi-core processors.”—Johan Vos, CTO, Cloud Products at Gluon, Java Champion “The combination of theory, clear explanation and example code makes this both a great learning experience and an excellent reference that is useful for any developer to have close at hand. Provides a great overview of the Java Platform Module System! I particularly like the way you explained the importance of modularity. Code examples are sufficiently complex to be realistic, but simple enough to understand. Covers all the topics I expected to see on modularity (more actually, especially around visualizing dependencies).”—Trisha Gee, JetBrains, Java Champion “Nice job on JShell. The most recent changes to Java are by far the biggest evolutions to the language and the platform in over 20 years. The changes are complex and intriguing, but Paul and Harvey have distilled the concepts to an easily digestible form, with plenty of examples. This book is an incredible, comprehensive source for deeper learning of Java and its ecosystem.”—Dr. Venkat Subramaniam, President, Agile Developer, Inc. and Instructional Professor, University of Houston “Gives the benefit of the wisdom derived from many years of software development experience!”—Edward F. Gehringer, North Carolina State University “Great book for studying the world’s most popular programming language. Introduces good design practices and methodologies from the beginning. Excellent starting point for developing high-quality, robust Java applications. Really good, clear explanation of object-oriented programming fundamentals. Excellent polymorphism chapter. Introduces JavaFX, the great new way to develop client applications in Java—I like the use of Scene Builder to create GUIs with drag-and-drop design rather than by hand, which shows the way it should be done. Excellent generic collections chapter. Covers lambdas and streams well.”—Simon Ritter, Oracle (now Deputy CTO at Azul Systems) “Want to take your Java skills to the next level? This book is the ultimate guide. I’ve enjoyed and learned much from it. Every major Java feature is masterfully covered. This is more than a book—it’s a career-building program. I really enjoyed t