𝔖 Scriptorium
✦   LIBER   ✦

📁

Learning Java: An Introduction to Real-World Programming with Java, 6th Edition (5th Early Release)

✍ Scribed by Marc Loy, Patrick Niemeyer, and Daniel Leuck


Publisher
O'Reilly Media, Inc.
Year
2023
Tongue
English
Leaves
497
Edition
6
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Ideal for working programmers new to Java, this best-selling book guides you through the language features and APIs of Java 21. Through fun, compelling, and realistic examples, author Marc Loy introduces you to Java fundamentals, including its class libraries, programming techniques, and idioms, with an eye toward building real applications.

This updated sixth edition expands the content to cover lambdas and streams, and shows you how to use a functional paradigm in Java. You'll learn about the latest Java features introduced since the book's fifth edition, from JDK 15 through 21. You'll also take a deep dive into the virtual threads introduced as Project Loom in Java 19 and become familiar with the public release of JDK 21 LTS.

The Java programming language was designed to be a machine-independent programming language that is both safe enough to traverse networks and powerful enough to replace native executable code. Java addresses the issues raised here and played a starring role in the growth of the internet, leading to where we are today.

Initially, most of the enthusiasm for Java centered on its capabilities for building embedded applications for the web, called applets. But in the early days, applets and other client-side graphical user interfaces (GUIs) written in Java were limited. Today, Java has Swing, a sophisticated toolkit for building GUIs. This development has allowed Java to become a viable platform for developing traditional client-side application software, although many other contenders have entered this crowded field.

This guide helps you:

Learn the structure of the Java language and Java applications
Write, compile, and execute Java applications
Understand the basics of Java threading and concurrent programming
Learn Java I/O basics, including local files and network resources
Create compelling interfaces with an eye toward usability
Learn how functional features have been integrated in Java
Keep up with Java developments as new versions are released

✦ Table of Contents


  1. A Modern Language
    Enter Java
    Java’s Origins
    Growing Up
    A Virtual Machine
    Java Compared with Other Languages
    Safety of Design
    Simplify, Simplify, Simplify…​
    Type Safety and Method Binding
    Incremental Development
    Dynamic Memory Management
    Error Handling
    Threads
    Scalability
    Safety of Implementation
    The Verifier
    Class Loaders
    Application and User-Level Security
    A Java Road Map
    The Past: Java 1.0–Java 20
    The Present: Java 21
    The Future
    Exercises
    1. A First Application
      Java Tools and Environment
      Installing the JDK
      Installing IntelliJ IDEA and Creating a Project
      Running the Project
      Grabbing the Examples
      HelloJava
      Classes
      The main() Method
      Classes and Objects
      Variables and Class Types
      HelloComponent
      Inheritance
      The JComponent Class
      Relationships and Finger-Pointing
      Packages and Imports
      The paintComponent() Method
      HelloJava2: The Sequel
      Instance Variables
      Constructors
      Events
      The repaint() Method
      Interfaces
      Goodbye and Hello Again
      Review Questions
      Code Exercises
    2. Tools of the Trade
      JDK Environment
      The Java VM
      Running Java Applications
      System Properties
      The Classpath
      CLASSPATH on Unix and macOS
      CLASSPATH on Windows
      CLASSPATH Wildcards
      Modules
      The Java Compiler
      Trying Java
      JAR Files
      The jar Utility
      Tool Wrap Up
      Review Questions
      Code Exercises
      Advanced Code Exercises
    3. The Java Language
      Text Encoding
      Comments
      Javadoc Comments
      Annotations
      Variables and Constants
      Types
      Primitive Types
      Reference Types
      A Word About Strings
      Statements and Expressions
      Statements
      Expressions
      Arrays
      Array Types
      Array Creation and Initialization
      Using Arrays
      Anonymous Arrays
      Multidimensional Arrays
      Types and Classes and Arrays, Oh My!
      Review Questions
      Code Exercises
      Advanced Exercises
    4. Objects in Java
      Classes
      Declaring and Instantiating Classes
      Accessing Fields and Methods
      Static Members
      Methods
      Local Variables
      Shadowing
      Static Methods
      Initializing Local Variables
      Argument Passing and References
      Wrappers for Primitive Types
      Method Overloading
      Object Creation
      Constructors
      Working with Overloaded Constructors
      Object Destruction
      Garbage Collection
      Packages
      Importing Classes
      Custom Packages
      Member Visibility and Access
      Compiling with Packages
      Advanced Class Design
      Subclassing and Inheritance
      Abstract Classes and Methods
      Interfaces
      Inner Classes
      Anonymous Inner Classes
      Organizing Content and Planning for Failure
      Review Questions
      Code Exercises
      Advanced Exercises
    5. Error Handling
      Exceptions
      Exceptions and Error Classes
      Exception Handling
      Bubbling Up
      Stack Traces
      Checked and Unchecked Exceptions
      Throwing Exceptions
      try Creep
      The finally Clause
      try with Resources
      Performance Issues
      Assertions
      Enabling and Disabling Assertions
      Using Assertions
      Real-World Exceptions
      Review Questions
      Code Exercises
      Advanced Exercises
    6. Collections and Generics
      Collections
      The Collection Interface
      Collection Types
      The Map Interface
      Type Limitations
      Containers: Building a Better Mousetrap
      Can Containers Be Fixed?
      Enter Generics
      Talking About Types
      “There Is No Spoon”
      Erasure
      Raw Types
      Parameterized Type Relationships
      Why Isn’t a List a List?
      Casts
      Converting Between Collections and Arrays
      Iterator
      A Closer Look: The sort() Method
      Application: Trees on the Field
      Useful Features
      Review Questions
      Code Exercises
      Advanced Exercises
    7. Text and Core Utilities
      Strings
      Constructing Strings
      Strings from Things
      Comparing Strings
      Searching
      String Method Summary
      Things from Strings
      Parsing Primitive Numbers
      Tokenizing Text
      Regular Expressions
      Regex Notation
      The java.util.regex API
      Math Utilities
      The java.lang.Math Class
      Big/Precise Numbers
      Dates and Times
      Local Dates and Times
      Comparing and Manipulating Dates and Times
      Time Zones
      Parsing and Formatting Dates and Times
      Formatting Dates and Times
      Timestamps
      Other Useful Utilities
      Review Questions
      Code Exercises
    8. Threads
      Introducing Threads
      The Thread Class and the Runnable Interface
      Controlling Threads
      Revisiting animation with threads
      Death of a Thread
      Virtual Threads
      Preview Feature Tangent
      A Quick Comparison
      Synchronization
      Serializing Access to Methods
      Accessing Class and Instance Variables from Multiple Threads
      Scheduling and Priority
      Thread State
      Time-Slicing
      Priorities
      Thread Performance
      The Cost of Synchronization
      Thread Resource Consumption
      Virtual Thread Performance
      Concurrency Utilities
      Upgrading Our Queue Demo
      Structured Concurrency
      So Many Threads to Pull
      Review Questions
      Code Exercises
    9. File Input and Output
      Streams
      Basic I/O
      Character Streams
      Stream Wrappers
      The java.io.File Class
      File Streams
      RandomAccessFile
      The New I/O File API
      FileSystem and Path
      NIO File Operations
      The NIO Package
      Asynchronous I/O
      Performance
      Mapped and Locked Files
      Channels
      Buffers
      Character Encoders and Decoders
      FileChannel
      File Channel Example
      wrap() Up
      Review Questions
      Code Exercises
      Advanced Exercises
    10. Functional Approaches in Java
      Functions 101
      Lambdas
      Lambda Expressions
      Functional Interfaces
      Method References
      Practical Lambdas: Sorting
      Streams
      Sources and Operations
      Filtering Streams
      Mapping Streams
      Flatmaps
      Reducing and Collecting
      Using Lambdas Directly
      Next Steps
      Review Questions
      Code Exercises
      Advanced Exercises
      A. Code Examples and IntelliJ IDEA
      Grabbing the Main Code Examples
      Importing the Examples
      B. Exercise Answers
      Chapter 1: A Modern Language
      Chapter 2: A First Application
      Code Exercises
      Chapter 3: Tools of the Trade
      Code Exercises
      Chapter 4: The Java Language
      Code Exercises
      Advanced Exercises
      Chapter 5: Objects in Java
      Code Exercises
      Advanced Exercises
      Chapter 6: Error Handling and Logging
      Code Exercises
      Advanced Exercises
      Chapter 7: Collections and Generics
      Code Exercises
      Advanced Exercises
      Chapter 8: Text and Core Utilities
      Code Exercises
      Chapter 9: Threads
      Code Exercises
      Chapter 10: File I/O
      Code Exercises
      Advanced Exercises
      Chapter 11: Functional Approaches
      Code Exercises
      Advanced Exercises
      Chapter 12: Desktop Applications
      Code Exercises
      Advanced Exercises
      Chapter 13: Network Programming
      Code Exercises
      Advanced Exercises

    11. 📜 SIMILAR VOLUMES


      Learning Java: An Introduction to Real-W
      ✍ Marc Loy, Patrick Niemeyer, Daniel Leuck 📂 Library 📅 2023 🏛 O'Reilly Media, Inc. 🌐 English

      Ideal for working programmers new to Java, this best-selling book guides you through the language features and APIs of Java 21. Through fun, compelling, and realistic examples, author Marc Loy introduces you to Java fundamentals, including its class libraries, programming techniques, and idioms, wit

      Learning Java: An Introduction to Real-W
      ✍ Marc Loy, Patrick Niemeyer, Daniel Leuck 📂 Library 📅 2020 🏛 O'Reilly Media 🌐 English

      <p><span>If you’re new to Java—or new to programming—this best-selling book will guide you through the language features and APIs of Java 11. With fun, compelling, and realistic examples, authors Marc Loy, Patrick Niemeyer, and Daniel Leuck introduce you to Java fundamentals—including its class libr

      Learning Java: An Introduction to Real-W
      ✍ Marc Loy;Patrick Niemeyer;Daniel Leuck 📂 Library 📅 2020 🏛 O’Reilly Media, Incorporated 🌐 English

      <p>If you're new to Java--or new to programming--this best-selling book will guide you through the language features and APIs of Java 11. With fun, compelling, and realistic examples, authors Marc Loy, Patrick Niemeyer, and Daniel Leuck introduce you to Java fundamentals--including its class librari

      Learning Java: An Introduction to Real-W
      ✍ Marc Loy, Patrick Niemeyer, Daniel Leuck 📂 Library 📅 2020 🏛 O'Reilly 🌐 English

      If you’re new to Java—or new to programming—this best-selling book will guide you through the language features and APIs of Java 11. With fun, compelling, and realistic examples, authors Marc Loy, Patrick Niemeyer, and Daniel Leuck introduce you to Java fundamentals—including its class libraries, pr

      Learning Java: An Introduction to Real-W
      ✍ Marc Loy, Patrick Niemeyer, Daniel Leuck 📂 Library 📅 2023 🏛 O'Reilly Media 🌐 English

      <p><span>Ideal for working programmers new to Java, this best-selling book guides you through the language features and APIs of Java 21. Through fun, compelling, and realistic examples, authors Marc Loy, Patrick Niemeyer, and Dan Leuck introduce you to Java's fundamentals, including its class librar