Categories
Bibliography Java Software Engineering

Java Cookbook – Problems and Solutions for Java Developers

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Java Cookbook – Problems and Solutions for Java Developers, 4th Edition, by Ian F. Darwin, 2020, B08651PDL6 (JvCkbk)

Fair Use Source: B08651PDL6 (JvCkbk)

About This Book:

Java continues to grow and evolve, and this cookbook continues to evolve in tandem. With this guide, you’ll get up to speed right away with hundreds of hands-on recipes across a broad range of Java topics. You’ll learn useful techniques for everything from string handling and functional programming to network communication.

Each recipe includes self-contained code solutions that you can freely use, along with a discussion of how and why they work. If you’re familiar with Java basics, this cookbook will bolster your knowledge of the language and its many recent changes, including how to apply them in your day-to-day development. This updated edition covers changes through Java 12 and parts of 13 and 14.

Recipes include:

  • Methods for compiling, running, and debugging
  • Packaging Java classes and building applications
  • Manipulating, comparing, and rearranging text
  • Regular expressions for string and pattern matching
  • Handling numbers, dates, and times
  • Structuring data with collections, arrays, and other types
  • Object-oriented and functional programming techniques
  • Input/output, directory, and filesystem operations
  • Network programming on both client and server
  • Processing JSON for data interchange
  • Multithreading and concurrency
  • Using Java in big data applications
  • Interfacing Java with other languages

About the Author:

Book Details:

  • ASIN : B08651PDL6
  • Publisher : O’Reilly Media; 4th edition (March 17, 2020)
  • Publication date : March 17, 2020
  • Print length : 949 pages

Publisher Resources

Table of Contents:

Table of Contents

  1. Preface
    1. Who This Book Is For
    2. What’s in This Book?
    3. Java Books
    4. Conventions Used in This Book
    5. O’Reilly Online Learning
    6. Comments and Questions
    7. Acknowledgments
  2. 1. Getting Started: Compiling and Running Java
    1. 1.0. Introduction
    2. 1.1. Compiling and Running Java: Standard JDK
    3. 1.2. Compiling and Running Java: GraalVM for Better Performance
    4. 1.3. Compiling, Running, and Testing with an IDE
    5. 1.4. Exploring Java with JShell
    6. 1.5. Using CLASSPATH Effectively
    7. 1.6. Downloading and Using the Code Examples
    8. 1.7. Automating Dependencies, Compilation, Testing, and Deployment with Apache Maven
    9. 1.8. Automating Dependencies, Compilation, Testing, and Deployment with Gradle
    10. 1.9. Dealing with Deprecation Warnings
    11. 1.10. Maintaining Code Correctness with Unit Testing: JUnit
    12. 1.11. Maintaining Your Code with Continuous Integration
    13. 1.12. Getting Readable Stack Traces
    14. 1.13. Finding More Java Source Code
    15. 1.14. Finding Runnable Java Libraries
  3. 2. Interacting with the Environment
    1. 2.0. Introduction
    2. 2.1. Getting Environment Variables
    3. 2.2. Getting Information from System Properties
    4. 2.3. Dealing with Code That Depends on the Java Version or the Operating System
    5. 2.4. Using Extensions or Other Packaged APIs
    6. 2.5. Using the Java Modules System
  4. 3. Strings and Things
    1. 3.0. Introduction
    2. 3.1. Taking Strings Apart with Substrings or Tokenizing
    3. 3.2. Putting Strings Together with StringBuilder
    4. 3.3. Processing a String One Character at a Time
    5. 3.4. Aligning, Indenting, and Unindenting Strings
    6. 3.5. Converting Between Unicode Characters and Strings
    7. 3.6. Reversing a String by Word or by Character
    8. 3.7. Expanding and Compressing Tabs
    9. 3.8. Controlling Case
    10. 3.9. Entering Nonprintable Characters
    11. 3.10. Trimming Blanks from the End of a String
    12. 3.11. Creating a Message with I18N Resources
    13. 3.12. Using a Particular Locale
    14. 3.13. Creating a Resource Bundle
    15. 3.14. Program: A Simple Text Formatter
    16. 3.15. Program: Soundex Name Comparisons
  5. 4. Pattern Matching with Regular Expressions
    1. 4.0. Introduction
    2. 4.1. Regular Expression Syntax
    3. 4.2. Using Regexes in Java: Test for a Pattern
    4. 4.3. Finding the Matching Text
    5. 4.4. Replacing the Matched Text
    6. 4.5. Printing All Occurrences of a Pattern
    7. 4.6. Printing Lines Containing a Pattern
    8. 4.7. Controlling Case in Regular Expressions
    9. 4.8. Matching Accented, or Composite, Characters
    10. 4.9. Matching Newlines in Text
    11. 4.10. Program: Apache Logfile Parsing
    12. 4.11. Program: Full Grep
  6. 5. Numbers
    1. 5.0. Introduction
    2. 5.1. Checking Whether a String Is a Valid Number
    3. 5.2. Converting Numbers to Objects and Vice Versa
    4. 5.3. Taking a Fraction of an Integer Without Using Floating Point
    5. 5.4. Working with Floating-Point Numbers
    6. 5.5. Formatting Numbers
    7. 5.6. Converting Among Binary, Octal, Decimal, and Hexadecimal
    8. 5.7. Operating on a Series of Integers
    9. 5.8. Formatting with Correct Plurals
    10. 5.9. Generating Random Numbers
    11. 5.10. Multiplying Matrices
    12. 5.11. Using Complex Numbers
    13. 5.12. Handling Very Large Numbers
    14. 5.13. Program: TempConverter
    15. 5.14. Program: Number Palindromes
  7. 6. Dates and Times
    1. 6.0. Introduction
    2. 6.1. Finding Today’s Date
    3. 6.2. Formatting Dates and Times
    4. 6.3. Converting Among Dates/Times, YMDHMS, and Epoch Seconds
    5. 6.4. Parsing Strings into Dates
    6. 6.5. Difference Between Two Dates
    7. 6.6. Adding to or Subtracting from a Date
    8. 6.7. Handling Recurring Events
    9. 6.8. Computing Dates Involving Time Zones
    10. 6.9. Interfacing with Legacy Date and Calendar Classes
  8. 7. Structuring Data with Java
    1. 7.0. Introduction
    2. 7.1. Using Arrays for Data Structuring
    3. 7.2. Resizing an Array
    4. 7.3. The Collections Framework
    5. 7.4. Like an Array, but More Dynamic
    6. 7.5. Using Generic Types in Your Own Class
    7. 7.6. How Shall I Iterate Thee? Let Me Enumerate the Ways
    8. 7.7. Eschewing Duplicates with a Set
    9. 7.8. Structuring Data in a Linked List
    10. 7.9. Mapping with Hashtable and HashMap
    11. 7.10. Storing Strings in Properties and Preferences
    12. 7.11. Sorting a Collection
    13. 7.12. Avoiding the Urge to Sort
    14. 7.13. Finding an Object in a Collection
    15. 7.14. Converting a Collection to an Array
    16. 7.15. Making Your Data Iterable
    17. 7.16. Using a Stack of Objects
    18. 7.17. Multidimensional Structures
    19. 7.18. Simplifying Data Objects with Lombok or Record
    20. 7.19. Program: Timing Comparisons
  9. 8. Object-Oriented Techniques
    1. 8.0. Introduction
    2. 8.1. Object Methods: Formatting Objects with toString(), Comparing with Equals
    3. 8.2. Using Inner Classes
    4. 8.3. Providing Callbacks via Interfaces
    5. 8.4. Polymorphism/Abstract Methods
    6. 8.5. Using Typesafe Enumerations
    7. 8.6. Avoiding NPEs with Optional
    8. 8.7. Enforcing the Singleton Pattern
    9. 8.8. Roll Your Own Exceptions
    10. 8.9. Using Dependency Injection
    11. 8.10. Program: Plotter
  10. 9. Functional Programming Techniques: Functional Interfaces, Streams, and Parallel Collections
    1. 9.0. Introduction
    2. 9.1. Using Lambdas/Closures Instead of Inner Classes
    3. 9.2. Using Lambda Predefined Interfaces Instead of Your Own
    4. 9.3. Simplifying Processing with Streams
    5. 9.4. Simplifying Streams with Collectors
    6. 9.5. Improving Throughput with Parallel Streams and Collections
    7. 9.6. Using Existing Code as Functional with Method References
    8. 9.7. Java Mixins: Mixing in Methods
  11. 10. Input and Output: Reading, Writing, and Directory Tricks
    1. 10.0. Introduction
    2. 10.1. About InputStreams/OutputStreams and Readers/Writers
    3. 10.2. Reading a Text File
    4. 10.3. Reading from the Standard Input or from the Console/Controlling Terminal
    5. 10.4. Printing with Formatter and printf
    6. 10.5. Scanning Input with StreamTokenizer
    7. 10.6. Scanning Input with the Scanner Class
    8. 10.7. Scanning Input with Grammatical Structure
    9. 10.8. Copying a File
    10. 10.9. Reassigning the Standard Streams
    11. 10.10. Duplicating a Stream as It Is Written; Reassigning Standard Streams
    12. 10.11. Reading/Writing a Different Character Set
    13. 10.12. Those Pesky End-of-Line Characters
    14. 10.13. Beware Platform-Dependent File Code
    15. 10.14. Reading/Writing Binary Data
    16. 10.15. Reading and Writing JAR or ZIP Archives
    17. 10.16. Finding Files in a Filesystem-Neutral Way with getResource() and getResourceAsStream()
    18. 10.17. Getting File Information: Files and Path
    19. 10.18. Creating a New File or Directory
    20. 10.19. Changing a File’s Name or Other Attributes
    21. 10.20. Deleting a File
    22. 10.21. Creating a Transient/Temporary File
    23. 10.22. Listing a Directory
    24. 10.23. Getting the Directory Roots
    25. 10.24. Using the FileWatcher Service to Get Notified About File Changes
    26. 10.25. Program: Save User Data to Disk
    27. 10.26. Program: Find—Walking a File Tree
  12. 11. Data Science and R
    1. 11.1. Machine Learning with Java
    2. 11.2. Using Data In Apache Spark
    3. 11.3. Using R Interactively
    4. 11.4. Comparing/Choosing an R Implementation
    5. 11.5. Using R from Within a Java App: Renjin
    6. 11.6. Using Java from Within an R Session
    7. 11.7. Using FastR, the GraalVM Implementation of R
    8. 11.8. Using R in a Web App
  13. 12. Network Clients
    1. 12.0. Introduction
    2. 12.1. HTTP/REST Web Client
    3. 12.2. Contacting a Socket Server
    4. 12.3. Finding and Reporting Network Addresses
    5. 12.4. Handling Network Errors
    6. 12.5. Reading and Writing Textual Data
    7. 12.6. Reading and Writing Binary or Serialized Data
    8. 12.7. UDP Datagrams
    9. 12.8. URI, URL, or URN?
    10. 12.9. Program: TFTP UDP Client
    11. 12.10. Program: Sockets-Based Chat Client
    12. 12.11. Program: Simple HTTP Link Checker
  14. 13. Server-Side Java
    1. 13.0. Introduction
    2. 13.1. Opening a Server Socket for Business
    3. 13.2. Finding Network Interfaces
    4. 13.3. Returning a Response (String or Binary)
    5. 13.4. Returning Object Information Across a Network Connection
    6. 13.5. Handling Multiple Clients
    7. 13.6. Serving the HTTP Protocol
    8. 13.7. Securing a Web Server with SSL and JSSE
    9. 13.8. Creating a REST Service with JAX-RS
    10. 13.9. Network Logging
    11. 13.10. Setting Up SLF4J
    12. 13.11. Network Logging with Log4j
    13. 13.12. Network Logging with java.util.logging
  15. 14. Processing JSON Data
    1. 14.0. Introduction
    2. 14.1. Generating JSON Directly
    3. 14.2. Parsing and Writing JSON with Jackson
    4. 14.3. Parsing and Writing JSON with org.json
    5. 14.4. Parsing and Writing JSON with JSON-B
    6. 14.5. Finding JSON Elements with JSON Pointer
  16. 15. Packages and Packaging
    1. 15.0. Introduction
    2. 15.1. Creating a Package
    3. 15.2. Documenting Classes with Javadoc
    4. 15.3. Beyond Javadoc: Annotations/Metadata
    5. 15.4. Preparing a Class as a JavaBean
    6. 15.5. Archiving with JAR
    7. 15.6. Running a Program from a JAR
    8. 15.7. Packaging Web Tier Components into a WAR File
    9. 15.8. Creating a Smaller Distribution with jlink
    10. 15.9. Using JPMS to Create a Module
  17. 16. Threaded Java
    1. 16.0. Introduction
    2. 16.1. Running Code in a Different Thread
    3. 16.2. Displaying a Moving Image with Animation
    4. 16.3. Stopping a Thread
    5. 16.4. Rendezvous and Timeouts
    6. 16.5. Synchronizing Threads with the synchronized Keyword
    7. 16.6. Simplifying Synchronization with Locks
    8. 16.7. Simplifying Producer/Consumer with the Queue Interface
    9. 16.8. Optimizing Parallel Processing with Fork/Join
    10. 16.9. Scheduling Tasks: Future Times, Background Saving in an Editor
  18. 17. Reflection, or “A Class Named Class”
    1. 17.0. Introduction
    2. 17.1. Getting a Class Descriptor
    3. 17.2. Finding and Using Methods and Fields
    4. 17.3. Accessing Private Methods and Fields via Reflection
    5. 17.4. Loading and Instantiating a Class Dynamically
    6. 17.5. Constructing a Class from Scratch with a ClassLoader
    7. 17.6. Constructing a Class from Scratch with JavaCompiler
    8. 17.7. Performance Timing
    9. 17.8. Printing Class Information
    10. 17.9. Listing Classes in a Package
    11. 17.10. Using and Defining Annotations
    12. 17.11. Finding Plug-In-Like Classes via Annotations
    13. 17.12. Program: CrossRef
  19. 18. Using Java with Other Languages
    1. 18.0. Introduction
    2. 18.1. Running an External Program from Java
    3. 18.2. Running a Program and Capturing Its Output
    4. 18.3. Calling Other Languages via javax.script
    5. 18.4. Mixing Languages with GraalVM
    6. 18.5. Marrying Java and Perl
    7. 18.6. Calling Other Languages via Native Code
    8. 18.7. Calling Java from Native Code
  20. Afterword
  21. Java Then and Now
    1. Introduction: Always in Motion the Java Is
    2. What Was New in Java 8
    3. What Was New in Java 9
    4. What Was New in Java 10 (March 2018)
    5. What Was New in Java 11 (September 2018)
    6. What Was New in Java 12 (March 2019)
    7. What Is New in Java 13 (September 2019)
    8. Looking Ahead
  22. Index

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Java – A Beginner’s Guide, by Herbert Schildt

See also: Java – The Complete Reference, Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Java – A Beginner’s Guide, 8th Edition, by Herbert Schildt, 2018, B07J2ZZ29H (JvBgnGd)

Fair Use Source: B07J2ZZ29H (JvBgnGd)

About This Book:

A practical introduction to Java programming—fully revised for long-term support release Java SE 11

Thoroughly updated for Java Platform Standard Edition 11, this hands-on resource shows, step by step, how to get started programming in Java from the very first chapter. Written by Java guru Herbert Schildt, the book starts with the basics, such as how to create, compile, and run a Java program. From there, you will learn essential Java keywords, syntax, and commands.

Java: A Beginner’s Guide, Eighth Edition covers the basics and touches on advanced features, including multithreaded programming, generics, Lambda expressions, and Swing. Enumeration, modules, and interface methods are also clearly explained. This Oracle Press guide delivers the appropriate mix of theory and practical coding necessary to get you up and running developing Java applications in no time.

  • Clearly explains all of the new Java SE 11 features
  • Features self-tests, exercises, and downloadable code samples
  • Written by bestselling author and leading Java authority Herbert Schildt

About the Author:

Herbert Schildt is one of the world’s leading programming authors and has written extensively on Java, C, C++, and C#. His books have sold millions of copies worldwide. Herb’s acclaimed books include Java: The Complete Reference, Java: A Beginner’s Guide, C: The Complete Reference, C++: The Complete Reference and C#: The Complete Reference

Book Details:

  • ASIN : B07J2ZZ29H
  • Publisher : McGraw-Hill Education; 8th edition (November 9, 2018)
  • Publication date : November 9, 2018
  • Print length : 720 pages

Table of Contents:

Published by McGraw-Hill, 2018

  1. Cover (01:09 mins)
  2. Title Page (01:09 mins)
  3. Copyright Page (03:27 mins)
  4. Contents at a Glance (01:09 mins)
  5. Contents (09:12 mins)
  6. Introduction (12:39 mins)
  7. 1 Java Fundamentals (60:57 mins)
  8. 2 Introducing Data Types and Operators (46:00 mins)
  9. 3 Program Control Statements (56:21 mins)
  10. 4 Introducing Classes, Objects, and Methods (43:42 mins)
  11. 5 More Data Types and Operators (75:54 mins)
  12. 6 A Closer Look at Methods and Classes (67:51 mins)
  13. 7 Inheritance (64:24 mins)
  14. 8 Packages and Interfaces (56:21 mins)
  15. 9 Exception Handling (42:33 mins)
  16. 10 Using I/O (66:42 mins)
  17. 11 Multithreaded Programming (66:42 mins)
  18. 12 Enumerations, Autoboxing, Static Import, and Annotations (44:51 mins)
  19. 13 Generics (57:30 mins)
  20. 14 Lambda Expressions and Method References (50:36 mins)
  21. 15 Modules (50:36 mins)
  22. 16 Introducing Swing (58:39 mins)
  23. A Answers to Self Tests (70:09 mins)
  24. B Using Java’s Documentation Comments (10:21 mins)
  25. C Compile and Run Simple Single-File Programs in One Step (03:27 mins)
  26. D Introducing JShell (17:15 mins)
  27. E More Java Keywords (06:54 mins)
  28. Index (29:54 mins)

Detailed Table of Contents

1 Java Fundamentals

  1. The History and Philosophy of Java
    1. The Origins of Java
    2. Java’s Lineage: C and C++
    3. How Java Impacted the Internet
    4. Java’s Magic: The Bytecode
    5. Moving Beyond Applets
    6. A Faster Release Schedule
    7. The Java Buzzwords
  2. Object-Oriented Programming
    1. Encapsulation
    2. Polymorphism
    3. Inheritance
  3. The Java Development Kit
  4. A First Simple Program
    1. Entering the Program
    2. Compiling the Program
    3. The First Sample Program Line by Line
  5. Handling Syntax Errors
  6. A Second Simple Program
  7. Another Data Type
  8. Try This 1-1: Converting Gallons to Liters
  9. Two Control Statements
    1. The if Statement
    2. The for Loop
  10. Create Blocks of Code
  11. Semicolons and Positioning
  12. Indentation Practices
  13. Try This 1-2: Improving the Gallons-to-Liters Converter
  14. The Java Keywords
  15. Identifiers in Java
  16. The Java Class Libraries
  17. Chapter 1 Self Test

2 Introducing Data Types and Operators

  1. Why Data Types Are Important
  2. Java’s Primitive Types
    1. Integers
    2. Floating-Point Types
    3. Characters
  3. The Boolean Type
  4. Try This 2-1: How Far Away Is the Lightning?
  5. Literals
    1. Hexadecimal, Octal, and Binary Literals
    2. Character Escape Sequences
    3. String Literals
  6. A Closer Look at Variables
    1. Initializing a Variable
    2. Dynamic Initialization
  7. The Scope and Lifetime of Variables
  8. Operators
  9. Arithmetic Operators
    1. Increment and Decrement
  10. Relational and Logical Operators
  11. Short-Circuit Logical Operators
  12. The Assignment Operator
  13. Shorthand Assignments
  14. Type Conversion in Assignments
  15. Casting Incompatible Types
  16. Operator Precedence
  17. Try This 2-2: Display a Truth Table for the Logical Operators
  18. Expressions
    1. Type Conversion in Expressions
    2. Spacing and Parentheses
  19. Chapter 2 Self Test

3 Program Control Statements

  1. Input Characters from the Keyboard
  2. The if Statement
  3. Nested ifs
  4. The if-else-if Ladder
  5. The switch Statement
  6. Nested switch Statements
  7. Try This 3-1: Start Building a Java Help System
  8. The for Loop
  9. Some Variations on the for Loop
  10. Missing Pieces
    1. The Infinite Loop
  11. Loops with No Body
  12. Declaring Loop Control Variables Inside the for Loop
  13. The Enhanced for Loop
  14. The while Loop
  15. The do-while Loop
  16. Try This 3-2: Improve the Java Help System
  17. Use break to Exit a Loop
  18. Use break as a Form of goto
  19. Use continue
  20. Try This 3-3: Finish the Java Help System
  21. Nested Loops
  22. Chapter 3 Self Test

4 Introducing Classes, Objects, and Methods

  1. Class Fundamentals
    1. The General Form of a Class
    2. Defining a Class
  2. How Objects Are Created
  3. Reference Variables and Assignment
  4. Methods
    1. Adding a Method to the Vehicle Class
  5. Returning from a Method
  6. Returning a Value
  7. Using Parameters
    1. Adding a Parameterized Method to Vehicle
  8. Try This 4-1: Creating a Help Class
  9. Constructors
  10. Parameterized Constructors
  11. Adding a Constructor to the Vehicle Class
  12. The new Operator Revisited
  13. Garbage Collection
  14. The this Keyword
  15. Chapter 4 Self Test

5 More Data Types and Operators

  1. Arrays
    1. One-Dimensional Arrays
  2. Try This 5-1: Sorting an Array
  3. Multidimensional Arrays
    1. Two-Dimensional Arrays
    2. Irregular Arrays
    3. Arrays of Three or More Dimensions
    4. Initializing Multidimensional Arrays
  4. Alternative Array Declaration Syntax
  5. Assigning Array References
  6. Using the length Member
  7. Try This 5-2: A Queue Class
  8. The For-Each Style for Loop
    1. Iterating Over Multidimensional Arrays
    2. Applying the Enhanced for
  9. Strings
    1. Constructing Strings
    2. Operating on Strings
    3. Arrays of Strings
    4. Strings Are Immutable
    5. Using a String to Control a switch Statement
  10. Using Command-Line Arguments
  11. Using Type Inference with Local Variables
    1. Local Variable Type Inference with Reference Types
    2. Using Local Variable Type Inference in a for Loop
    3. Some var Restrictions
  12. The Bitwise Operators
    1. The Bitwise AND, OR, XOR, and NOT Operators
    2. The Shift Operators
    3. Bitwise Shorthand Assignments
  13. Try This 5-3: A ShowBits Class
  14. The ? Operator
  15. Chapter 5 Self Test

6 A Closer Look at Methods and Classes

  1. Controlling Access to Class Members
    1. Java’s Access Modifiers
  2. Try This 6-1: Improving the Queue Class
  3. Pass Objects to Methods
    1. How Arguments Are Passed
  4. Returning Objects
  5. Method Overloading
  6. Overloading Constructors
  7. Try This 6-2: Overloading the Queue Constructor
  8. Recursion
  9. Understanding static
    1. Static Blocks
  10. Try This 6-3: The Quicksort
  11. Introducing Nested and Inner Classes
  12. Varargs: Variable-Length Arguments
    1. Varargs Basics
    2. Overloading Varargs Methods
    3. Varargs and Ambiguity
  13. Chapter 6 Self Test

7 Inheritance

  1. Inheritance Basics
  2. Member Access and Inheritance
  3. Constructors and Inheritance
  4. Using super to Call Superclass Constructors
  5. Using super to Access Superclass Members
  6. Try This 7-1: Extending the Vehicle Class
  7. Creating a Multilevel Hierarchy
  8. When Are Constructors Executed?
  9. Superclass References and Subclass Objects
  10. Method Overriding
  11. Overridden Methods Support Polymorphism
  12. Why Overridden Methods?
    1. Applying Method Overriding to TwoDShape
  13. Using Abstract Classes
  14. Using final
    1. final Prevents Overriding
    2. final Prevents Inheritance
    3. Using final with Data Members
  15. The Object Class
  16. Chapter 7 Self Test

8 Packages and Interfaces

  1. Packages
    1. Defining a Package
    2. Finding Packages and CLASSPATH
    3. A Short Package Example
  2. Packages and Member Access
    1. A Package Access Example
  3. Understanding Protected Members
  4. Importing Packages
  5. Java’s Class Library Is Contained in Packages
  6. Interfaces
  7. Implementing Interfaces
  8. Using Interface References
  9. Try This 8-1: Creating a Queue Interface
  10. Variables in Interfaces
  11. Interfaces Can Be Extended
  12. Default Interface Methods
    1. Default Method Fundamentals
    2. A More Practical Example of a Default Method
    3. Multiple Inheritance Issues
  13. Use static Methods in an Interface
  14. Private Interface Methods
  15. Final Thoughts on Packages and Interfaces
  16. Chapter 8 Self Test

9 Exception Handling

  1. The Exception Hierarchy
  2. Exception Handling Fundamentals
    1. Using try and catch
    2. A Simple Exception Example
  3. The Consequences of an Uncaught Exception
    1. Exceptions Enable You to Handle Errors Gracefully
  4. Using Multiple catch Statements
  5. Catching Subclass Exceptions
  6. Try Blocks Can Be Nested
  7. Throwing an Exception
    1. Rethrowing an Exception
  8. A Closer Look at Throwable
  9. Using finally
  10. Using throws
  11. Three Additional Exception Features
  12. Java’s Built-in Exceptions
  13. Creating Exception Subclasses
  14. Try This 9-1: Adding Exceptions to the Queue Class
  15. Chapter 9 Self Test

10 Using I/O

  1. Java’s I/O Is Built upon Streams
  2. Byte Streams and Character Streams
  3. The Byte Stream Classes
  4. The Character Stream Classes
  5. The Predefined Streams
  6. Using the Byte Streams
    1. Reading Console Input
    2. Writing Console Output
  7. Reading and Writing Files Using Byte Streams
    1. Inputting from a File
    2. Writing to a File
  8. Automatically Closing a File
  9. Reading and Writing Binary Data
  10. Try This 10-1: A File Comparison Utility
  11. Random-Access Files
  12. Using Java’s Character-Based Streams
    1. Console Input Using Character Streams
    2. Console Output Using Character Streams
  13. File I/O Using Character Streams
    1. Using a FileWriter
    2. Using a FileReader
  14. Using Java’s Type Wrappers to Convert Numeric Strings
  15. Try This 10-2: Creating a Disk-Based Help System
  16. Chapter 10 Self Test

11 Multithreaded Programming

  1. Multithreading Fundamentals
  2. The Thread Class and Runnable Interface
  3. Creating a Thread
    1. One Improvement and Two Simple Variations
  4. Try This 11-1: Extending Thread
  5. Creating Multiple Threads
  6. Determining When a Thread Ends
  7. Thread Priorities
  8. Synchronization
  9. Using Synchronized Methods
  10. The synchronized Statement
  11. Thread Communication Using notify( ), wait( ), and notifyAll( )
    1. An Example That Uses wait( ) and notify( )
  12. Suspending, Resuming, and Stopping Threads
  13. Try This 11-2: Using the Main Thread
  14. Chapter 11 Self Test

12 Enumerations, Autoboxing, Static Import, and Annotations

  1. Enumerations
    1. Enumeration Fundamentals
  2. Java Enumerations Are Class Types
  3. The values( ) and valueOf( ) Methods
  4. Constructors, Methods, Instance Variables, and Enumerations
    1. Two Important Restrictions
  5. Enumerations Inherit Enum
  6. Try This 12-1: A Computer-Controlled Traffic Light
  7. Autoboxing
  8. Type Wrappers
  9. Autoboxing Fundamentals
  10. Autoboxing and Methods
  11. Autoboxing/Unboxing Occurs in Expressions
    1. A Word of Warning
  12. Static Import
  13. Annotations (Metadata)
  14. Chapter 12 Self Test

13 Generics

  1. Generics Fundamentals
  2. A Simple Generics Example
    1. Generics Work Only with Reference Types
    2. Generic Types Differ Based on Their Type Arguments
    3. A Generic Class with Two Type Parameters
    4. The General Form of a Generic Class
  3. Bounded Types
  4. Using Wildcard Arguments
  5. Bounded Wildcards
  6. Generic Methods
  7. Generic Constructors
  8. Generic Interfaces
  9. Try This 13-1: Create a Generic Queue
  10. Raw Types and Legacy Code
  11. Type Inference with the Diamond Operator
  12. Local Variable Type Inference and Generics
  13. Erasure
  14. Ambiguity Errors
  15. Some Generic Restrictions
    1. Type Parameters Can’t Be Instantiated
    2. Restrictions on Static Members
    3. Generic Array Restrictions
    4. Generic Exception Restriction
  16. Continuing Your Study of Generics
  17. Chapter 13 Self Test

14 Lambda Expressions and Method References

  1. Introducing Lambda Expressions
    1. Lambda Expression Fundamentals
    2. Functional Interfaces
    3. Lambda Expressions in Action
  2. Block Lambda Expressions
  3. Generic Functional Interfaces
  4. Try This 14-1: Pass a Lambda Expression as an Argument
  5. Lambda Expressions and Variable Capture
  6. Throw an Exception from Within a Lambda Expression
  7. Method References
    1. Method References to static Methods
    2. Method References to Instance Methods
  8. Constructor References
  9. Predefined Functional Interfaces
  10. Chapter 14 Self Test

15 Modules

  1. Module Basics
    1. A Simple Module Example
    2. Compile and Run the First Module Example
    3. A Closer Look at requires and exports
  2. java.base and the Platform Modules
  3. Legacy Code and the Unnamed Module
  4. Exporting to a Specific Module
  5. Using requires transitive
  6. Try This 15-1: Experiment with requires transitive
  7. Use Services
    1. Service and Service Provider Basics
    2. The Service-Based Keywords
    3. A Module-Based Service Example
  8. Additional Module Features
    1. Open Modules
    2. The opens Statement
    3. requires static
  9. Continuing Your Study of Modules
  10. Chapter 15 Self Test

16 Introducing Swing

  1. The Origins and Design Philosophy of Swing
  2. Components and Containers
    1. Components
    2. Containers
    3. The Top-Level Container Panes
  3. Layout Managers
  4. A First Simple Swing Program
    1. The First Swing Example Line by Line
  5. Swing Event Handling
    1. Events
    2. Event Sources
    3. Event Listeners
    4. Event Classes and Listener Interfaces
  6. Use JButton
  7. Work with JTextField
  8. Create a JCheckBox
  9. Work with JList
  10. Try This 16-1: A Swing-Based File Comparison Utility
  11. Use Anonymous Inner Classes or Lambda Expressions to Handle Events
  12. Chapter 16 Self Test

A Answers to Self Tests

  1. Chapter 1: Java Fundamentals
  2. Chapter 2: Introducing Data Types and Operators
  3. Chapter 3: Program Control Statements
  4. Chapter 4: Introducing Classes, Objects, and Methods
  5. Chapter 5: More Data Types and Operators
  6. Chapter 6: A Closer Look at Methods and Classes
  7. Chapter 7: Inheritance
  8. Chapter 8: Packages and Interfaces
  9. Chapter 9: Exception Handling
  10. Chapter 10: Using I/O
  11. Chapter 11: Multithreaded Programming
  12. Chapter 12: Enumerations, Autoboxing, Static Import, and Annotations
  13. Chapter 13: Generics
  14. Chapter 14: Lambda Expressions and Method References
  15. Chapter 15: Modules
  16. Chapter 16: Introducing Swing

B Using Java’s Documentation Comments

  1. The javadoc Tags
    1. @author
    2. {@code}
    3. @deprecated
    4. {@docRoot}
    5. @exception
    6. @hidden
    7. {@index}
    8. {@inheritDoc}
    9. {@link}
    10. {@linkplain}
    11. {@literal}
    12. @param
    13. @provides
    14. @return
    15. @see
    16. @since
    17. {@summary}
    18. @throws
    19. @uses
    20. {@value}
    21. @version
  2. The General Form of a Documentation Comment
  3. What javadoc Outputs
  4. An Example That Uses Documentation Comments

C Compile and Run Simple Single-File Programs in One StepD Introducing JShell

  1. JShell Basics
  2. List, Edit, and Rerun Code
  3. Add a Method
  4. Create a Class
  5. Use an Interface
  6. Evaluate Expressions and Use Built-in Variables
  7. Importing Packages
  8. Exceptions
  9. Some More JShell Commands
  10. Exploring JShell Further

E More Java Keywords

  1. The transient and volatile Modifiers
  2. instanceof
  3. strictfp
  4. assert
  5. Native Methods
  6. Another Form of this

Index

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

The Well-Grounded Java Developer

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: The Well-Grounded Java Developer, Second Edition, by Benjamin Evans, Jason Clark, and Martijn Verburg, 2021, 1617298875 (WelGrJvDv)

Fair Use Source: 1617298875 (WelGrJvDv)

Previous version from 2012, New version available Summer 2021

About This Book:

Understanding Java from the JVM up gives you a solid foundation to grow your expertise and take on advanced techniques for performance, concurrency, containerization, and more.

In The Well-Grounded Java Developer, Second Edition you will learn:

  • The new Java module system and why you should use it
  • Bytecode for the JVM, including operations and classloading
  • Performance tuning the JVM
  • Working with Java’s built-in concurrency and expanded options
  • Programming in Kotlin and Clojure on the JVM
  • Maximizing the benefits from your build/CI tooling with Maven and Gradle
  • Running the JVM in containers
  • Planning for future JVM releases

The Well-Grounded Java Developer, Second Edition introduces both the modern innovations and timeless fundamentals you need to know to become a Java master. Authors Ben Evans, Martijn Verburg, and Jason Clark distil their decades of experience as Java Champions, veteran developers, and key contributors to the Java ecosystem into this clear and practical guide.

about the technology

Java’s history of innovation, its huge collection of libraries and frameworks, and the flexibility of the JVM have cemented its place as one of the world’s most popular programming languages. Although it’s easy to get started with Java, understanding how the language intersects with the JVM is the key to unlocking the power of this awesome language and its deep ecosystem of frameworks, tools, and alternative JVM-based languages.

about the book

The Well-Grounded Java Developer, Second Edition is a complete revision of the classic original with the latest innovations of the Java platform. It upgrades your existing Java skills with both JVM fundamentals like bytecode, and powerful new features such as modules and concurrency models.

You’ll broaden your understanding of what’s possible by exploring Kotlin and other JVM languages, and learn how functional programming can offer a powerful new perspective. Each concept is illustrated with hands-on examples, including a fully modularized application/library, build setups for Maven and Gradle, and creating your own multithreaded application.

about the reader

For intermediate Java developers. No experience with the latest Java version or JVM languages required.

About the Authors:

Martijn Verburg is the principal SWE group manager for the Java Engineering Group at Microsoft. He is the co-leader of the London Java User Group (LJC) where he co-founded AdoptOpenJDK, the world’s leading (non-Oracle) OpenJDK distribution. He has been made a Java Champion in recognition for his contribution to the Java ecosystem.

Jason Clark is a principal engineer and architect at New Relic, and was previously an architect at WebMD. A regular conference speaker, Jason contributes to the open-source project Shoes, aiming to make GUI programming easy and fun for beginners.

Book Details:

  • Publisher : Manning Publications; 1st edition (July 21, 2012), 2nd edition (August 2021)
  • Paperback : 496 pages
  • ISBN-10 : 1st edition 1617290068, 2nd edition 1617298875
  • ISBN-13 : 1st edition 978-1617290060, 2nd edition 978-1617298875

Table of Contents:

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Java Quick Syntax Reference, by Mikael Olsson

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Java Quick Syntax Reference, 2nd Edition, by Mikael Olsson, 2018, B079BKJ6CB (JvQSynRf)

Fair Use Source: B079BKJ6CB (JvQSynRf)

About This Book:

Quickly gain the insight necessary to address a multitude of Java coding challenges using this succinct reference guide. Short, focused code examples will help you master Java elements such as modules, boxing/unboxing and more.

You won’t find any technical jargon, bloated samples, drawn out history lessons or witty stories in this book. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any Java programmer.

What You Will Learn

  • Code with Java modules
  • Box/unbox 
  • Utilize exception handling

Who This Book Is For

Those with prior experience with Java who want a quick and handy reference. 

About the Author:

Mikael Olsson is a professional web entrepreneur, programmer, and author. He works for an R&D company in Finland where he specializes in software development. In his spare time he writes books and creates websites that summarize various fields of interest. The books he writes are focused on teaching their subject in the most efficient way possible, by explaining only what is relevant and practical without any unnecessary repetition or theory. The portal to his online businesses and other websites is Siforia.com.

Book Details:

  • ASIN : B079BKJ6CB
  • Publisher : Apress; 2nd edition (January 25, 2018)
  • Publication date : January 25, 2018
  • Print length : 113 pages

Table of Contents:

  1. Cover
  2. Front Matter
  3. 1. Hello World
  4. 2. Compile and Run
  5. 3. Variables
  6. 4. Operators
  7. 5. String
  8. 6. Arrays
  9. 7. Conditionals
  10. 8. Loops
  11. 9. Methods
  12. 10. Class
  13. 11. Static
  14. 12. Inheritance
  15. 13. Overriding
  16. 14. Packages and Import
  17. 15. Access Levels
  18. 16. Constants
  19. 17. Interface
  20. 18. Abstract
  21. 19. Enum
  22. 20. Exception Handling
  23. 21. Boxing and Unboxing
  24. 22. Generics
  25. 23. Lambda Expressions
  26. Back Matter

Sources:

Fair Use Sources:

Cover image
Categories
Bibliography Java Software Engineering

Head First Java, by Kathy Sierra and Bert Bates

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: Head First Java, 3rd Edition, by Kathy Sierra and Bert Bates, 2021, 1491910771 (HFJav)

Fair Use Source: 1491910771 (HFJav)

About This Book:

Learning a complex new language is no easy task especially when it s an object-oriented computer programming language like Java. You might think the problem is your brain. It seems to have a mind of its own, a mind that doesn’t always want to take in the dry, technical stuff you’re forced to study.

The fact is your brain craves novelty. It’s constantly searching, scanning, waiting for something unusual to happen. After all, that’s the way it was built to help you stay alive. It takes all the routine, ordinary, dull stuff and filters it to the background so it won’t interfere with your brain’s real work–recording things that matter. How does your brain know what matters? It’s like the creators of the Head First approach say, suppose you’re out for a hike and a tiger jumps in front of you, what happens in your brain? Neurons fire. Emotions crank up. Chemicals surge.

That’s how your brain knows.

And that’s how your brain will learn Java. Head First Java combines puzzles, strong visuals, mysteries, and soul-searching interviews with famous Java objects to engage you in many different ways. It’s fast, it’s fun, and it’s effective. And, despite its playful appearance, Head First Java is serious stuff: a complete introduction to object-oriented programming and Java. You’ll learn everything from the fundamentals to advanced topics, including threads, network sockets, and distributed programming with RMI. And the new. third edition focuses on Java 17, the latest version of the Java language and development platform.

What will you learn from this book?

Ready to learn Java? This book combines puzzles, strong visuals, mysteries, and soul-searching interviews with famous Java objects to engage you in many different ways. It’s fast, it’s fun, and it’s effective. And, despite its playful appearance, Head First Java is serious stuff: a complete introduction to object-oriented programming and Java. You’ll learn everything from the fundamentals to advanced topics.

The new third edition brings the book up to date for Java 8-17, including major recent updates to the Java language and development platform. Java has seen some deep, code-level changes and more modern approaches, requiring even more careful study and implementation. So learning the Head First way is more important than ever.

What’s so special about this book?

If you’ve read a Head First book, you know what to expect–a visually rich format designed for the way your brain works. If you haven’t, you’re in for a treat. With this book, you’ll learn Java through a multi-sensory experience that engages your mind, rather than a text-heavy approach that puts you to sleep.

About the Authors:

Kathy Sierra, SCJP, was a codeveloper of the SCJP SCEA exams. Along with her partner Bert Bates, Kathy Sierra created the award-winning Head First programming book series that has sold over 1 million copies, and includes the longest-running tech bestsellers of the past decade. Her background is in developing education games and software for the motion picture industry, and she also created the first interaction design courses for UCLA Entertainment Studies. For more than 15 years she’s been helping large companies, small start-ups, non-profits, and educators rethink their approach to user experience, and build sustainable, genuine loyalty.

Kathy has been interested in learning theory since her days as a game developer (Virgin, MGM, Amblin’). More recently, she’s been a master trainer for Sun Microsystems, teaching Sun’s Java instructors how to teach the latest technologies to customers, and a lead developer of several Sun certification exams. She’s also the original founder of the Software Development/Jolt Productivity Award-winning https://javaranch.com, the largest (and friendliest) all-volunteer Java community.

Bert Bates, SCJP, OCA, OCP, is a Sun Certified Programmer for Java and has been developing software for the last 20 years. He has participated in the development of the SCJP, SCEA, and SCWCD exams. Bert has been teaching software development, including Java programming, for many years. Bert Bates is a 20-year software developer, a Java instructor, and a co-developer of Sun’s EJB exam (Sun Certified Business Component Developer), the SCJP exam and the SCJD exam. Bert has also been teaching software development, including Java programming, for many years. His background features a long stint in artificial intelligence, with clients like the Weather Channel, A&E Network, Rockwell, and Timken.

Book Details:

  • ASIN : 1491910771
  • Publisher : O’Reilly Media; 3rd edition (December 2021)
    • 2nd edition (February 9, 2005)
  • Publication date : December 2021
  • Print length : ~ 1200 pages

Publisher Resources

Table of Contents:

  1. 1. Dive in A Quick Dip: Breaking the Surface
    1. The Way Java Works
    2. What you’ll do in Java
    3. A Very Brief History of Java
      1. Speed and Memory Usage
      2. Sharpen your pencil Answers
    4. Code structure in Java
      1. What goes in a source file?
      2. What goes in a class?
      3. What goes in a method?
    5. Anatomy of a class
    6. Writing a class with a main
    7. What can you say in the main method?
      1. Looping and looping and…
      2. Simple boolean tests
    8. There are no dumb Questions
    9. Example of a while loop
    10. Conditional branching
    11. Coding a Serious Business Application
      1. Monday Morning at Bob’s Java-Enabled House
    12. Phrase-O-Matic
    13. Code Magnets
      1. BE the compiler
    14. JavaCross 7.0
    15. Pool Puzzle
    16. Exercise Solutions
    17. puzzle answers
  2. 2. Classes and Objects: A Trip to Objectville
    1. Chair Wars
      1. (or How Objects Can Change Your Life)
      2. In Larry’s cube
      3. At Brad’s laptop at the cafe
      4. Larry thought he’d nailed it. He could almost feel the rolled steel of the Aeron beneath his…
      5. Back in Larry’s cube
      6. At Brad’s laptop at the beach
      7. Larry snuck in just moments ahead of Brad.
      8. Back in Larry’s cube
      9. At Brad’s laptop on his lawn chair at the Telluride Bluegrass Festival
      10. So, Brad the OO guy got the chair and desk, right?
    2. What about the Amoeba rotate()?
    3. The suspense is killing me. Who got the chair and desk?
      1. Brain Power
    4. When you design a class, think about the objects that will be created from that class t ype. Think about:
    5. What’s the difference between a class and an object?
      1. A class is not an object.
    6. Making your first object
    7. Making and testing Movie objects
    8. Quick! Get out of main!
      1. The Guessing Game
    9. Running the Guessing Game
    10. There are no Dumb Questions
      1. BE the compiler
    11. Code Magnets
      1. Pool Puzzle
    12. Exercise Solutions
    13. Puzzle Solutions
      1. Pool Puzzle
      2. Who am I?
  3. 3. Primitives And References: Know Your Variables
    1. Declaring a variable
      1. variables must have a type
      2. variables must have a name
    2. “I’d like a double mocha, no, make it an int.”
      1. Primitive Types
    3. You really don’t want to spill that…
    4. Back away from that keyword!
    5. Controlling your Dog object
    6. An object reference is just another variable value.
      1. The 3 steps of object declaration, creation and assignment
    7. There are no Dumb Questions
      1. Java Exposed
    8. Life on the garbage-collectible heap
      1. Life and death on the heap
      2. An array is like a tray of cups
      3. Arrays are objects too
      4. Make an array of Dogs
      5. Control your Dog
      6. What happens if the Dog is in a Dog array?
      7. A Dog example
      8. BE the compiler
      9. Code Magnets
    9. Pool Puzzle
    10. A Heap o’ Trouble
      1. The case of the pilfered references
    11. Exercise Solutions
    12. Puzzle Solutions
      1. The case of the pilfered references
  4. 4. methods use instance variables: How Objects Behave
    1. Remember: a class describes what an object knows and what an object does
      1. Can every object of that type have different method behavior?
      2. The size affects the bark
      3. You can send things to a method
    2. You can get things back from a method.
    3. You can send more than one thing to a method
      1. Calling a two-parameter method, and sending it two arguments.
    4. There are no Dumb Questions
      1. Reminder: Java cares about type!
    5. Cool things you can do with parameters and return types
    6. Encapsulation
      1. Do it or risk humiliation and ridicule.
      2. Hide the data
    7. Java Exposed
    8. Encapsulating the GoodDog class
      1. How do objects in an array behave?
    9. Declaring and initializing instance variables
    10. The difference between instance and local variables
    11. There are no Dumb Questions
    12. Comparing variables (primitives or references)
      1. BE the compiler
    13. Mixed Messages
    14. Pool Puzzle
      1. Fast Times in Stim-City
    15. Exercise Solutions
    16. Puzzle Solutions
  5. 5. Writing a Program: Extra-Strength Methods
    1. Let’s build a Battleship-style game: “Sink a Startup”
    2. First, a high-level design
    3. The “Simple Startup Game” a gentler introduction
    4. Developing a Class
    5. Brain Power
    6. SimpleStartup class
    7. Writing the method implementations
      1. let’s write the real method code now, and get this puppy working.
    8. Writing test code for the SimpleStartup class
    9. There are no Dumb Questions
    10. The checkYourself() method
    11. Just the new stuff
    12. There are no Dumb Questions
    13. Final code for SimpleStartup and SimpleStartupTester
    14. Prepcode for the SimpleStartupGame class
    15. The game’s main() method
    16. random() and getUserInput()
    17. One last class: GameHelper
      1. Let’s play
      2. What’s this? A bug ?
    18. More about for loops
      1. Regular (non-enhanced) for loops
    19. Trips through a loop
      1. Difference between for and while
    20. The enhanced for loop
    21. Casting primitives
      1. BE the JVM
    22. Code Magnets
    23. JavaCross
      1. Mixed Messages
    24. Exercise Solutions
      1. Puzzle Solutions

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Think Java – How to Think Like a Computer Scientist

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Think Java – How to Think Like a Computer Scientist, 2nd Edition, by Allen B. Downey and Chris Mayfield, 2019, B08234FFCX (TnkJav)

Fair Use Source: B08234FFCX (TnkJav)

About This Book:

Currently used at many colleges, universities, and high schools, this hands-on introduction to computer science is ideal for people with little or no programming experience. The goal of this concise book is not just to teach you Java, but to help you think like a computer scientist. You’ll learn how to program—a useful skill by itself—but you’ll also discover how to use programming as a means to an end.

Authors Allen Downey and Chris Mayfield start with the most basic concepts and gradually move into topics that are more complex, such as recursion and object-oriented programming. Each brief chapter covers the material for one week of a college course and includes exercises to help you practice what you’ve learned.

  • Learn one concept at a time: tackle complex topics in a series of small steps with examples
  • Understand how to formulate problems, think creatively about solutions, and write programs clearly and accurately
  • Determine which development techniques work best for you, and practice the important skill of debugging
  • Learn relationships among input and output, decisions and loops, classes and methods, strings and arrays
  • Work on exercises involving word games, graphics, puzzles, and playing cards

The updated second edition of Think Java also features new chapters on polymorphism and data processing, as well as content covering changes through Java 12.

About the Authors:

Allen B. Downey is a Professor of Computer Science at Olin College of Engineering. He has taught at Wellesley College, Colby College, and U.C. Berkeley. He has a Ph.D. in Computer Science from U.C. Berkeley, and Master’s and Bachelor’s degrees from MIT. Downey is the creator of the bestselling Think series for O’Reilly, including Think Python, Think Complexity, Think DSP, and Think Bayes.

Chris Mayfield is an Assistant Professor of Computer Science at James Madison University, with a research focus on CS education and professional development. He has a Ph.D. in Computer Science from Purdue University and Bachelor’s degrees in CS and German from the University of Utah. https://github.com/ChrisMayfield and https://w3.cs.jmu.edu/mayfiecs

Publisher Resources

Book Details:

  • ASIN : B08234FFCX
  • Publisher : O’Reilly Media; 2nd edition (November 27, 2019)
  • Publication date : November 27, 2019
  • Print length : 328 pages

Table of Contents:

Table of Contents

  1. Preface
    1. The Philosophy Behind the Book
    2. Object-Oriented Programming
    3. Changes to the Second Edition
    4. About the Appendixes
    5. Using the Code Examples
    6. Conventions Used in This Book
    7. O’Reilly Online Learning
    8. How to Contact Us
    9. Acknowledgments
  2. 1. Computer Programming
    1. What Is a Computer?
    2. What Is Programming?
    3. The Hello World Program
    4. Compiling Java Programs
    5. Displaying Two Messages
    6. Formatting Source Code
    7. Using Escape Sequences
    8. What Is Computer Science?
    9. Debugging Programs
    10. Vocabulary
    11. Exercises
  3. 2. Variables and Operators
    1. Declaring Variables
    2. Assigning Variables
    3. Memory Diagrams
    4. Printing Variables
    5. Arithmetic Operators
    6. Floating-Point Numbers
    7. Rounding Errors
    8. Operators for Strings
    9. Compiler Error Messages
    10. Other Types of Errors
    11. Vocabulary
    12. Exercises
  4. 3. Input and Output
    1. The System Class
    2. The Scanner Class
    3. Language Elements
    4. Literals and Constants
    5. Formatting Output
    6. Reading Error Messages
    7. Type Cast Operators
    8. Remainder Operator
    9. Putting It All Together
    10. The Scanner Bug
    11. Vocabulary
    12. Exercises
  5. 4. Methods and Testing
    1. Defining New Methods
    2. Flow of Execution
    3. Parameters and Arguments
    4. Multiple Parameters
    5. Stack Diagrams
    6. Math Methods
    7. Composition
    8. Return Values
    9. Incremental Development
    10. Vocabulary
    11. Exercises
  6. 5. Conditionals and Logic
    1. Relational Operators
    2. The if-else Statement
    3. Chaining and Nesting
    4. The switch Statement
    5. Logical Operators
    6. De Morgan’s Laws
    7. Boolean Variables
    8. Boolean Methods
    9. Validating Input
    10. Example Program
    11. Vocabulary
    12. Exercises
  7. 6. Loops and Strings
    1. The while Statement
    2. Increment and Decrement
    3. The for Statement
    4. Nested Loops
    5. Characters
    6. Which Loop to Use
    7. String Iteration
    8. The indexOf Method
    9. Substrings
    10. String Comparison
    11. String Formatting
    12. Vocabulary
    13. Exercises
  8. 7. Arrays and References
    1. Creating Arrays
    2. Accessing Elements
    3. Displaying Arrays
    4. Copying Arrays
    5. Traversing Arrays
    6. Generating Random Numbers
    7. Building a Histogram
    8. The Enhanced for Loop
    9. Counting Characters
    10. Vocabulary
    11. Exercises
  9. 8. Recursive Methods
    1. Recursive Void Methods
    2. Recursive Stack Diagrams
    3. Value-Returning Methods
    4. The Leap of Faith
    5. Counting Up Recursively
    6. Binary Number System
    7. Recursive Binary Method
    8. CodingBat Problems
    9. Vocabulary
    10. Exercises
  10. 9. Immutable Objects
    1. Primitives Versus Objects
    2. The null Keyword
    3. Strings Are Immutable
    4. Wrapper Classes
    5. Command-Line Arguments
    6. Argument Validation
    7. BigInteger Arithmetic
    8. Incremental Design
    9. More Generalization
    10. Vocabulary
    11. Exercises
  11. 10. Mutable Objects
    1. Point Objects
    2. Objects as Parameters
    3. Objects as Return Values
    4. Rectangles Are Mutable
    5. Aliasing Revisited
    6. Java Library Source
    7. Class Diagrams
    8. Scope Revisited
    9. Garbage Collection
    10. Mutable Versus Immutable
    11. StringBuilder Objects
    12. Vocabulary
    13. Exercises
  12. 11. Designing Classes
    1. The Time Class
    2. Constructors
    3. Value Constructors
    4. Getters and Setters
    5. Displaying Objects
    6. The toString Method
    7. The equals Method
    8. Adding Times
    9. Vocabulary
    10. Exercises
  13. 12. Arrays of Objects
    1. Card Objects
    2. Card toString
    3. Class Variables
    4. The compareTo Method
    5. Cards Are Immutable
    6. Arrays of Cards
    7. Sequential Search
    8. Binary Search
    9. Tracing the Code
    10. Vocabulary
    11. Exercises
  14. 13. Objects of Arrays
    1. Decks of Cards
    2. Shuffling Decks
    3. Selection Sort
    4. Merge Sort
    5. Subdecks
    6. Merging Decks
    7. Adding Recursion
    8. Static Context
    9. Piles of Cards
    10. Playing War
    11. Vocabulary
    12. Exercises
  15. 14. Extending Classes
    1. CardCollection
    2. Inheritance
    3. Dealing Cards
    4. The Player Class
    5. The Eights Class
    6. Class Relationships
    7. Vocabulary
    8. Exercises
  16. 15. Arrays of Arrays
    1. Conway’s Game of Life
    2. The Cell Class
    3. Two-Dimensional Arrays
    4. The GridCanvas Class
    5. Other Grid Methods
    6. Starting the Game
    7. The Simulation Loop
    8. Exception Handling
    9. Counting Neighbors
    10. Updating the Grid
    11. Vocabulary
    12. Exercises
  17. 16. Reusing Classes
    1. Langton’s Ant
    2. Refactoring
    3. Abstract Classes
    4. UML Diagram
    5. Vocabulary
    6. Exercises
  18. 17. Advanced Topics
    1. Polygon Objects
    2. Adding Color
    3. Regular Polygons
    4. More Constructors
    5. An Initial Drawing
    6. Blinking Polygons
    7. Interfaces
    8. Event Listeners
    9. Timers
    10. Vocabulary
    11. Exercises
  19. A. Tools
    1. Installing DrJava
    2. DrJava Interactions
    3. Command-Line Interface
    4. Command-Line Testing
    5. Running Checkstyle
    6. Tracing with a Debugger
    7. Testing with JUnit
    8. Vocabulary
  20. B. Javadoc
    1. Reading Documentation
    2. Writing Documentation
    3. Javadoc Tags
    4. Example Source File
    5. Vocabulary
  21. C. Graphics
    1. Creating Graphics
    2. Graphics Methods
    3. Example Drawing
    4. Vocabulary
    5. Exercises
  22. D. Debugging
    1. Compile-Time Errors
      1. The compiler is spewing error messages.
      2. I’m getting a weird compiler message, and it won’t go away.
      3. I can’t get my program to compile no matter what I do.
      4. I did what the compiler told me to do, but it still doesn’t work.
    2. Run-Time Errors
      1. My program hangs.
      2. When I run the program, I get an exception.
      3. I added so many print statements I get inundated with output.
    3. Logic Errors
      1. My program doesn’t work.
      2. I’ve got a big, hairy expression and it doesn’t do what I expect.
      3. My method doesn’t return what I expect.
      4. My print statement isn’t doing anything.
      5. I’m really, really stuck and I need help.
      6. No, I really need help.
      7. I found the bug!
  23. Index

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Java for Absolute Beginners, by Iuliana Cosmina

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Java for Absolute Beginners – Learn to Program the Fundamentals the Java 9+ Way, by Iuliana Cosmina, 2018, B07L5C7GHH (JvAbBgn)

Fair Use Source: B07L5C7GHH (JvAbBgn)

About This Book:

Write your first code in Java using simple, step-by-step examples that model real-word objects and events, making learning easy. With this book you’ll be able to pick up the concepts without fuss. Java for Absolute Beginners teaches Java development in language anyone can understand, giving you the best possible start. You’ll see clear code descriptions and layout so that you can get your code running as soon as possible. After reading this book, you’ll come away with the basics to get started writing programs in Java.

Author Iuliana Cosmina focuses on practical knowledge and getting up to speed quickly—all the bits and pieces a novice needs to get started programming in Java. First, you’ll discover how Java is executed, what type of language it is, and what it is good for. With the theory out of the way, you’ll install Java, choose an editor such as IntelliJ IDEA, and write your first simple Java program. Along the way you’ll compile and execute this program so it can run on any platform that supports Java. As part of this tutorial you’ll see how to write high-quality code by following conventions and respecting well-known programming principles, making your projects more professional and efficient.

Finally, alongside the core features of Java, you’ll learn skills in some of the newest and most exciting features of the language: Generics, Lambda expressions, modular organization, local-variable type inference, and local variable syntax for Lambda expressions.

Java for Absolute Beginners gives you all you need to start your Java 9+ programming journey. No experience necessary.

 What You’ll Learn

  • Use data types, operators, and the new stream API
  • Install and use a build tool such as Gradle
  • Build interactive Java applications with JavaFX 
  • Exchange data using the new JSON APIs 
  • Play with images using multi-resolution APIs
  • Use the publish-subscribe framework

Who This Book Is For

Those who are new to programming and who want to start with Java.

About the Author:

Iuliana Cosmina is currently a Software Engineer for NCR Edinburgh. She has been writing Java code since 2002 and contributed to various types of applications such as experimental search engines, ERPs, track and trace, and banking. During her career, she has been a teacher, a team leader, software architect, DevOps professional and software manager. She is a Spring-certified Professional, as defined by Pivotal, the makers of Spring Framework, Boot, and other tools, and considers Spring the best Java framework to work with. When she is not programming, she spends her time reading, blogging, learning to play piano, travelling, hiking or biking.

Book Details:

  • ASIN : B07L5C7GHH
  • Publisher : Apress; 1st ed. edition (December 5, 2018)
  • Publication date : December 5, 2018
  • Print length : 702 pages

Table of Contents:

Table of Contents

New Version for 2021:

Write your first code in Java 17 using simple, step-by-step examples that model real-word objects and events, making learning easy. With Java 17 for Absolute Beginners  you’ll be able to pick up the concepts without fuss. It teaches Java development in language anyone can understand, giving you the best possible start. 

You’ll see clear code descriptions and layout so that you can get your code running as soon as possible. Author Iuliana Cosmina focuses on practical knowledge and getting you up to speed quickly—all the bits and pieces a novice needs to get started programming in Java. 

First, you’ll discover what type of language Java is, what it is good for, and how it is executed. With the theory out of the way, you’ll install Java, choose an editor such as IntelliJ IDEA, and write your first simple Java program. Along the way you’ll compile and execute this program so it can run on any platform that supports Java. As part of this tutorial you’ll see how to write high-quality code by following conventions and respecting well-known programming principles, making your projects more professional and efficient. 

Java 17 for Absolute Beginners gives you all you need to start your Java programming journey. No experience necessary. After reading this book, you’ll come away with the basics to get started writing programs in Java.\

https://apress.com/us/book/9781484270790 and https://smile.amazon.com/Java-Absolute-Beginners-Fundamentals-Programming/dp/1484270797

 What You Will Learn

  • Get started with Java 17 from scratch
  • Install and use the IntelliJ IDEA and the Gradle build tool
  • Exchange data using the new JSON APIs 
  • Play with images using multi-resolution APIs
  • Implement the publish-subscribe architecture

Sources:

Fair Use Sources:

Cover image
Categories
Bibliography Java Software Engineering

Modern Java in Action

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: Modern Java in Action – Lambdas, streams, functional and reactive programming, 2nd Edition, by Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft, 2018, 1617293563 (ModJavAc)

Fair Use Source: 1617293563 (ModJavAc)

About This Book:

Manning’s bestselling Java 8 book has been revised for Java 9 and 10! In Modern Java in Action, you’ll build on your existing Java language skills with the newest features and techniques.

about the technology

Modern applications take advantage of innovative designs, including microservices, reactive architectures, and streaming data. Modern Java features like lambdas, streams, and the long-awaited Java Module System make implementing these designs significantly easier. It’s time to upgrade your skills and meet these challenges head on!

about the book

Modern Java in Action connects new features of the Java language with their practical applications. Using crystal-clear examples and careful attention to detail, this book respects your time. It will help you expand your existing knowledge of core Java as you master modern additions like the Streams API and the Java Module System, explore new approaches to concurrency, and learn how functional concepts can help you write code that’s easier to read and maintain.

what’s inside

  • Thoroughly revised edition of Manning’s bestselling Java 8 in Action
  • New features in Java 8, Java 9, and beyond
  • Streaming data and reactive programming
  • The Java Module System

about the reader

Written for developers familiar with core Java features.

Reviews

“My Java code improved significantly after reading this book. I was able to take the clear examples and immediately put them intopractice.”–Holly Cummins, IBM

“A comprehensive and practical introduction to the modern features of the latest Java releases with excellent examples!”–Oleksandr Mandryk, EPAM Systems

“Hands-on Java 8 and 9, simply and elegantly explained.”–Deepak Bhaskaran, Salesforce

“A lot of great examples and use cases for streams, concurrency, andreactive programming.”–Rob Pacheco, Synopsys

About the Authors:

Raoul-Gabriel Urma is CEO and co-founder of Cambridge Spark, a leading learning community for data scientists and developers in UK. In addition, he is also Chairman and co-founder of Cambridge Coding Academy, a growing community of young coders and pre-university students. Raoul is author of the bestselling programming book “Java 8 in Action” which sold over 20,000 copies globally. Raoul completed a PhD in Computer Science at the University of Cambridge. In addition, he holds a MEng in Computer Science from Imperial College London and graduated with first class honours having won several prizes for technical innovation. Raoul has delivered over 100 technical talks at international conferences. He has worked for Google, eBay, Oracle, and Goldman Sachs. He is also a Fellow of the Royal Society of Arts.

Mario Fusco is a senior software engineer at Red Hat working on Drools, the JBoss rule engine. He created the open source library lambdaj, an internal Java DSL for manipulating collections in a functional way.

Alan Mycroft is Professor of Computer Science at the University of Cambridge, where he researches programming languages, their semantics, optimization and implementation. He is a co-founder and Trustee of the Raspberry Pi Foundation.

Book Details:

  • Publisher : Manning Publications; 2nd edition (November 15, 2018)
  • Language : English
  • Paperback : 592 pages
  • ISBN-10 : 1617293563
  • ISBN-13 : 978-1617293566

Table of Contents:

Copyright
Brief Table of Contents
Table of Contents
Praise for the previous edition, Java 8 in Action, by Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft.
Preface
Acknowledgments
About this book
About the authors
About the cover illustration
Part 1. Fundamentals

Chapter 1. Java 8, 9, 10, and 11: what’s happening?
Chapter 2. Passing code with behavior parameterization
Chapter 3. Lambda expressions

Part 2. Functional-style data processing with streams

Chapter 4. Introducing streams
Chapter 5. Working with streams
Chapter 6. Collecting data with streams
Chapter 7. Parallel data processing and performance

Part 3. Effective programming with streams and lambdas

Chapter 8. Collection API enhancements
Chapter 9. Refactoring, testing, and debugging
Chapter 10. Domain-specific languages using lambdas

Part 4. Everyday Java

Chapter 11. Using Optional as a better alternative to null
Chapter 12. New Date and Time API
Chapter 13. Default methods
Chapter 14. The Java Module System

Part 5. Enhanced Java concurrency

Chapter 15. Concepts behind CompletableFuture and reactive programming
Chapter 16. CompletableFuture: composable asynchronous programming
Chapter 17. Reactive programming

Part 6. Functional programming and future Java evolution

Chapter 18. Thinking functionally
Chapter 19. Functional programming techniques
Chapter 20. Blending OOP and FP: Comparing Java and Scala
Chapter 21. Conclusions and where next for Java

Appendix A. Miscellaneous language updates
Appendix B. Miscellaneous library updates
Appendix C. Performing multiple operations in parallel on a stream
Appendix D. Lambdas and JVM bytecode
Index
List of Figures
List of Tables
List of Listings

Sources:

Fair Use Sources:

Categories
Java Software Engineering

Joshua Bloch

Joshua Bloch is a professor at Carnegie Mellon University. He was formerly the chief Java architect at Google, a distinguished engineer at Sun Microsystems, and a senior systems designer at Transarc. He led the design and implementation of numerous Java platform features, including the JDK 5.0 language enhancements and the Java Collections Framework. He holds a Ph.D. in computer science from Carnegie Mellon University and a B.S. in computer science from Columbia University. He is the author of Effective Java.

Joshuabloch.jpg
Bloch in 2008

BornAugust 28, 1961 (age 59)
Southampton, New York
NationalityAmerican
Alma materColumbia University (B.S.)
Carnegie Mellon University (Ph.D.)
Scientific career
InstitutionsCarnegie Mellon University
Doctoral advisorAlfred Spector

Joshua J. Bloch (born August 28, 1961) is an American software engineer and a technology author, formerly employed at Sun Microsystems and Google. He led the design and implementation of numerous Java platform features, including the Java Collections Framework, the java.math package, and the assert mechanism.[1] He is the author of the programming guide Effective Java (2001), which won the 2001 Jolt Award,[2] and is a co-author of two other Java books, Java Puzzlers (2005) and Java Concurrency In Practice (2006).” (WP)

Bloch holds a B.S. in computer science from Columbia University and a Ph.D. in computer science from Carnegie Mellon University.[1] His 1990 thesis was titled A Practical Approach to Replication of Abstract Data Objects[3] and was nominated for the ACM Distinguished Doctoral Dissertation Award.[4]

Bloch has worked as a Senior Systems Designer at Transarc, and later as a Distinguished Engineer at Sun Microsystems. In June 2004, he left Sun and became Chief Java Architect at Google.[5] On August 3, 2012, Bloch announced that he would be leaving Google.[6]

In December 2004, Java Developer’s Journal included Bloch in its list of the “Top 40 Software People in the World”.[7]

Bloch has proposed the extension of the Java programming language with two features: Concise Instance Creation Expressions (CICE) (coproposed with Bob Lee and Doug Lea) and Automatic Resource Management (ARM) blocks. The combination of CICE and ARM formed one of the three early proposals for adding support for closures to Java.[8] ARM blocks were added to the language in JDK7.[9]

Bloch is currently an affiliated faculty member of the Institute for Software Research at Carnegie Mellon University, where he holds the title “Adjunct Professor of the Practice“.[10]

Bibliography

References

  1. a b “About the Author”Effective Java Programming Language Guide
  2. ^ 2002 Jolt & Productivity Award Winners Archived 2007-05-03 at the Wayback Machine. Dr. Dobb’s Portal.
  3. ^ A Practical Approach to Replication of Abstract Data Objects. Computer Science Department, School of Computer Science, Carnegie Mellon University. May 1990.
  4. ^ Books & Authors: Effective Java, accessed 16 April 2008
  5. ^ Heiss, Janet J. (2007). “Rock Star Josh Bloch”JavaOne. Archived from the original on 27 October 2007.
  6. ^ Joshua Bloch, After eight years at Google, the time has come for me to move on
  7. ^ Geelan, Jeremy (2004-12-21). “The i-Technology Right Stuff”Java Developer’s Journal.
  8. ^ Kreft, Klaus; Langer, Angelika (17 June 2008). “Understanding the closures debate”JavaWorld. Retrieved 2020-07-20.
  9. ^ Darcy, Joseph D. (28 August 2009). “Project Coin: The Final Five (Or So)”Joseph D. Darcy’s Oracle Weblog. Oracle. Retrieved 6 May 2014.
  10. ^ “Faculty”Institute for Software ResearchCarnegie Mellon University. Retrieved 31 August 2020.

External links

Categories

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Effective Java, by Joshua Bloch

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: Effective Java, 3rd Edition, by Joshua Bloch, 2017, B078H61SCH (EftJav)

Fair Use Source: B078H61SCH (EftJav)

About This Book:

Java has changed dramatically since the previous edition of Effective Java was published shortly after the release of Java 6. This Jolt award-winning classic has now been thoroughly updated to take full advantage of the latest language and library features. The support in modern Java for multiple paradigms increases the need for specific best-practices advice, and this book delivers.

As in previous editions, each chapter of Effective Java, Third Edition, consists of several “items,” each presented in the form of a short, stand-alone essay that provides specific advice, insight into Java platform subtleties, and updated code examples. The comprehensive descriptions and explanations for each item illuminate what to do, what not to do, and why.

The third edition covers language and library features added in Java 7, 8, and 9, including the functional programming constructs that were added to its object-oriented roots. Many new items have been added, including a chapter devoted to lambdas and streams.

New coverage includes

  • Functional interfaces, lambda expressions, method references, and streams
  • Default and static methods in interfaces
  • Type inference, including the diamond operator for generic types
  • The @SafeVarargs annotation
  • The try-with-resources statement
  • New library features such as the Optional interface, java.time, and the convenience factory methods for collections

About the Author:

Joshua Bloch is a professor at Carnegie Mellon University. He was formerly the chief Java architect at Google, a distinguished engineer at Sun Microsystems, and a senior systems designer at Transarc. He led the design and implementation of numerous Java platform features, including the JDK 5.0 language enhancements and the Java Collections Framework. He holds a Ph.D. in computer science from Carnegie Mellon University and a B.S. in computer science from Columbia University.

Book Details:

  • ASIN : B078H61SCH
  • Publisher : Addison-Wesley Professional; 3rd edition (December 18, 2017)
  • Publication date : December 18, 2017
  • Print length : 414 pages

Table of Contents:

Table of Contents

1 Introduction

2 Creating and Destroying Objects

  1. Item 1: Consider static factory methods instead of constructors
  2. Item 2: Consider a builder when faced with many constructor parameters
  3. Item 3: Enforce the singleton property with a private constructor or an enum type
  4. Item 4: Enforce noninstantiability with a private constructor
  5. Item 5: Prefer dependency injection to hardwiring resources
  6. Item 6: Avoid creating unnecessary objects
  7. Item 7: Eliminate obsolete object references
  8. Item 8: Avoid finalizers and cleaners
  9. Item 9: Prefer try-with-resources to try-finally

3 Methods Common to All Objects

  1. Item 10: Obey the general contract when overriding equals
  2. Item 11: Always override hashCode when you override equals
  3. Item 12: Always override toString
  4. Item 13: Override clone judiciously
  5. Item 14: Consider implementing Comparable

4 Classes and Interfaces

  1. Item 15: Minimize the accessibility of classes and members
  2. Item 16: In public classes, use accessor methods, not public fields
  3. Item 17: Minimize mutability
  4. Item 18: Favor composition over inheritance
  5. Item 19: Design and document for inheritance or else prohibit it
  6. Item 20: Prefer interfaces to abstract classes
  7. Item 21: Design interfaces for posterity
  8. Item 22: Use interfaces only to define types
  9. Item 23: Prefer class hierarchies to tagged classes
  10. Item 24: Favor static member classes over nonstatic
  11. Item 25: Limit source files to a single top-level class

5 Generics

  1. Item 26: Don’t use raw types
  2. Item 27: Eliminate unchecked warnings
  3. Item 28: Prefer lists to arrays
  4. Item 29: Favor generic types
  5. Item 30: Favor generic methods
  6. Item 31: Use bounded wildcards to increase API flexibility
  7. Item 32: Combine generics and varargs judiciously
  8. Item 33: Consider typesafe heterogeneous containers

6 Enums and Annotations

  1. Item 34: Use enums instead of int constants
  2. Item 35: Use instance fields instead of ordinals
  3. Item 36: Use EnumSet instead of bit fields
  4. Item 37: Use EnumMap instead of ordinal indexing
  5. Item 38: Emulate extensible enums with interfaces
  6. Item 39: Prefer annotations to naming patterns
  7. Item 40: Consistently use the Override annotation
  8. Item 41: Use marker interfaces to define types

7 Lambdas and Streams

  1. Item 42: Prefer lambdas to anonymous classes
  2. Item 43: Prefer method references to lambdas
  3. Item 44: Favor the use of standard functional interfaces
  4. Item 45: Use streams judiciously
  5. Item 46: Prefer side-effect-free functions in streams
  6. Item 47: Prefer Collection to Stream as a return type
  7. Item 48: Use caution when making streams parallel

8 Methods

  1. Item 49: Check parameters for validity
  2. Item 50: Make defensive copies when needed
  3. Item 51: Design method signatures carefully
  4. Item 52: Use overloading judiciously
  5. Item 53: Use varargs judiciously
  6. Item 54: Return empty collections or arrays, not nulls
  7. Item 55: Return optionals judiciously
  8. Item 56: Write doc comments for all exposed API elements

9 General Programming

  1. Item 57: Minimize the scope of local variables
  2. Item 58: Prefer for-each loops to traditional for loops
  3. Item 59: Know and use the libraries
  4. Item 60: Avoid float and double if exact answers are required
  5. Item 61: Prefer primitive types to boxed primitives
  6. Item 62: Avoid strings where other types are more appropriate
  7. Item 63: Beware the performance of string concatenation
  8. Item 64: Refer to objects by their interfaces
  9. Item 65: Prefer interfaces to reflection
  10. Item 66: Use native methods judiciously
  11. Item 67: Optimize judiciously
  12. Item 68: Adhere to generally accepted naming conventions

10 Exceptions

  1. Item 69: Use exceptions only for exceptional conditions
  2. Item 70: Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
  3. Item 71: Avoid unnecessary use of checked exceptions
  4. Item 72: Favor the use of standard exceptions
  5. Item 73: Throw exceptions appropriate to the abstraction
  6. Item 74: Document all exceptions thrown by each method
  7. Item 75: Include failure-capture information in detail messages
  8. Item 76: Strive for failure atomicity
  9. Item 77: Don’t ignore exceptions

11 Concurrency

  1. Item 78: Synchronize access to shared mutable data
  2. Item 79: Avoid excessive synchronization
  3. Item 80: Prefer executors, tasks, and streams to threads
  4. Item 81: Prefer concurrency utilities to wait and notify
  5. Item 82: Document thread safety
  6. Item 83: Use lazy initialization judiciously
  7. Item 84: Don’t depend on the thread scheduler

12 Serialization

  1. Item 85: Prefer alternatives to Java serialization
  2. Item 86: Implement Serializable with great caution
  3. Item 87: Consider using a custom serialized form
  4. Item 88: Write readObject methods defensively
  5. Item 89: For instance control, prefer enum types to readResolve
  6. Item 90: Consider serialization proxies instead of serialized instances

Items Corresponding to Second Edition

References

Index

Code Snippets

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Core Java – Volume II – Advanced Features, by Cay S. Horstmann

See also Core Java – Volume I – Fundamentals, Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: Core Java – Volume II – Advanced Features, 11th Edition, by Cay S. Horstmann, 2019, B07NCXJR1M (CorJav2)

Fair Use Source: B07NCXJR1M (CorJav2)

About This Book:

The #1 Guide to Advanced Java Programming, Fully Updated for Java 11

Core Java has long been recognized as the leading, no-nonsense tutorial and reference for experienced programmers who want to write robust Java code for real-world applications. Now, Core Java, Volume II—Advanced Features, Eleventh Edition, has been updated for Java 11, with up-to-date coverage of advanced UI and enterprise programming, networking, security, and Java’s powerful new module system.

Cay S. Horstmann explores sophisticated new language and library features with the depth and completeness that readers expect from Core Java. He demonstrates how to use these features to build professional-quality applications, using thoroughly tested examples that reflect modern Java style and best practices, including modularization. Horstmann’s examples are carefully crafted for easy understanding and maximum practical value, so you can consistently use them to jump-start your own code.

  • Master advanced techniques, idioms, and best practices for writing superior Java code
  • Take full advantage of modern Java I/O APIs, object serialization, and regular expressions
  • Efficiently connect to network services, implement network clients and servers, and harvest web data
  • Query databases and manage database connections with the latest version of JDBC
  • Simplify all aspects of date and time programming with the Java Date and Time API
  • Write internationalized programs that localize dates, times, numbers, text, and GUIs
  • Process code in three powerful ways: the scripting API, compiler API, and annotation processing
  • Learn how to migrate legacy code to the Java Platform Module System
  • Leverage the modern Java security features most valuable to application programmers
  • Program advanced client-side user interfaces, and generate images on the server
  • Use JNI to interoperate with native C code

See Core Java, Volume I—Fundamentals, Eleventh Edition (ISBN-13: 978-0-13-516630-7), for expert coverage of fundamental Java and UI programming, including objects, generics, collections, lambda expressions, Swing design, concurrency, and functional programming.

About the Author:

Cay S. Horstmann is a professor of computer science at San Jose State University and a Java Champion. He is also the author of Core Java, Volume I and Core Java, Volume II, Eleventh EditionCore Java SE 9 for the ImpatientSecond Edition (Addison-Wesley, 2018), and Scala for the Impatient, Second Edition (Addison-Wesley, 2017). He has written more than a dozen other books for professional programmers and computer science students.

Book Details:

  • ASIN : B07NCXJR1M
  • Publisher : Pearson; 11th edition (February 11, 2019)
  • Publication date : February 11, 2019
  • Print length : 960 pages

Table of Contents:

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Core Java – Volume I – Fundamentals, by Cay S. Horstmann

See also Core Java – Volume II – Advanced Features, Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Core Java – Volume I – Fundamentals, 11th Edition, by Cay S. Horstmann, 2020, B07G8DHTSZ (CorJav1)

Fair Use Source: B07G8DHTSZ (CorJav1)

About This Book:

The #1 Guide for Serious Programmers: Fully Updated for Java SE 9, 10 & 11

Cay Horstmann’s Core Java, Volume I—Fundamentals, Eleventh Edition, is the definitive guide to writing robust, maintainable code with the Java SE 9, 10, and 11 language and libraries. Horstmann writes for serious programmers who use Java in production projects, and need a deep, practical understanding of the language and API. Throughout, he delivers what you need most: hundreds of real (non-toy) examples revealing the most powerful, effective ways to get the job done.

Updated examples reflect the new var keyword and take advantage of improvements in the Java API. You’ll learn how to use JShell’s new Read-Eval-Print Loop (REPL) for more rapid and exploratory development, and apply new features of the APIs for streams, input/output, processes, and concurrency.

In this first of two volumes, Horstmann offers in-depth coverage of fundamental Java and UI programming, including object-oriented programming, generics, collections, lambda expressions, Swing design, concurrency, and functional programming. If you’re an experienced programmer moving to Java SE 9, 10, or 11, there’s no better source for expert insight, solutions, and code.

  • Master foundational techniques, idioms, and best practices for writing superior Java code
  • Efficiently implement encapsulation and inheritance
  • Use sound principles of object-oriented design
  • Leverage the full power of objects with interfaces, lambda expressions, and inner classes
  • Harden programs through effective exception handling and debugging
  • Write safer, more reusable code with generic programming
  • Improve performance and efficiency with Java’s standard collections
  • Build cross-platform GUIs with the Swing toolkit
  • Fully utilize multicore processors with Java’s improved concurrency

See Core Java, Volume II—Advanced Features, Eleventh Edition (ISBN-13: 978-0-13-516631-4), for expert coverage of Java 9, 10, and 11 enterprise features, the module system, annotations, networking, security, and advanced UI programming.

About the Author:

Cay S. Horstmann is a professor of computer science at San Jose State University and a Java Champion. He is also the author of Core Java, Volume I and Core Java, Volume II, Eleventh EditionCore Java SE 9 for the ImpatientSecond Edition (Addison-Wesley, 2018), and Scala for the Impatient, Second Edition (Addison-Wesley, 2017). He has written more than a dozen other books for professional programmers and computer science students.

Book Details:

  • ASIN : B07G8DHTSZ
  • Publisher : Pearson; 11th edition (September 28, 2020)
  • Publication date : September 28, 2020
  • Print length : 916 pages

Table of Contents:

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Java Pocket Guide – Instant Help for Java Programmers

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

See: Java Pocket Guide – Instant Help for Java Programmers, 4th Edition, by Robert Liguori, 2017, B0756P3CZD (JvPktGd)

Fair Use Source: B0756P3CZD (JvPktGd)

About This Book:

Any time you need quick answers for developing or debugging Java programs, this pocket guide is the ideal reference to standard features of the Java programming language and its platform. You’ll find helpful programming examples, tables, figures, and lists fast—including Java 9 features such as modular source code and the new JShell interactive command-line REPL. It’s a handy companion, whether you’re in the office, in the lab, or on the road.

This book also provides material to help you prepare for the Oracle Certified Associate Java Programmer exam.

  • Quickly find Java language details, such as naming conventions, types, statements and blocks, and object-oriented programming
  • Get details on the Java SE platform, including development basics, memory management, concurrency, and generics
  • Use new features in Java 9, including modular source code and JShell
  • Browse through information on basic input/output, NIO 2.0, the Java collections framework, and the Java Scripting API
  • Get supplemental references to fluent APIs, third-party tools, and basics of the Unified Modeling Language (UML)

About the Author:

Robert Liguori is an Oracle Certified Java Professional and a software developer / test engineer for several Java-based air traffic management applications. Robert has a Bachelors degree in Computer Science and Information Technology from Richard Stockton College of New Jersey.

Book Details:

  • ASIN : B0756P3CZD
  • Publisher : O’Reilly Media; 4th edition (August 28, 2017)
  • Publication date : August 28, 2017
  • Print length : 360 pages

Preface:

“Designed to be your companion, this Pocket Guide provides a quick reference to the standard features of the Java programming language and its platform.

This Pocket Guide provides you with the information you will need while developing or debugging your Java programs, including helpful programming examples, tables, figures, and lists.

Java coverage in this book is representative through Java SE 9 incorporating a subset of the 80+ JDK Enhancement Proposals (JEPs) slated for the release. This Java coverage includes improvements to the generage language as well as coverage of the new Java Shell and the new Java Module System. This book supercedes the three previous versions: Java Pocket Guide, Java 7 Pocket Guide, and Java 8 Pocket Guide.

For uniformity and enhanced interest, the majority of the code examples in this fourth edition of the Java Pocket Guide have been updated from code segments of the Gliesians Web Application. At the time of this writing, the primary focus of the Gliesians Web Application is to provide free utilities relative to genealogy and small unmanned aerial systems.

The material in this book also provides support in preparing for the Oracle Certified Programmer exams. If you are considering pursuing one of the Java certifications, you may also wish to acquire the OCA Java SE 8 Programmer I Study Guide (Exam 1Z0-808) by Edward Finegan and Robert Liguori (McGraw-Hill Osborne Media, 2015).

Table of Contents:

Preface

Book Structure

Conventions Used in This Book

O’Reilly Safari

How to Contact Us

Acknowledgments

I. Language

  1. Java Naming Conventions
  • Java Acronyms
  • Java Annotation Names
  • Java Class Names
  • Java Constant Names
  • Java Enumeration Names
  • Java Generic Type Parameter Names
  • Java Instance and Static Variable Names
  • Java Interface Names
  • Java Method Names
  • Java Package Names
  • Java Module Names
  • Java Parameter and Local Variable Names
  1. Java Lexical Elements
  • Java Unicode and ASCII
    • Java Printable ASCII Characters
    • Java Nonprintable ASCII Characters
    • Java Compact Strings
  • Java Comments
  • Java Keywords
  • Java Identifiers
  • Java Separators
  • Java Operators
  • Java Literals
    • Java Boolean Literals
    • Java Character Literals
    • Java Integer Literals
    • Java Floating-Point Literals
    • Java String Literals
    • Java Null Literals
  • Java Escape Sequences
  • Java Unicode Currency Symbols
  1. Java Fundamental Types
  • Java Primitive Types
  • Literals for Primitive Types
  • Java Floating-Point Entities
    • Java Operations Involving Special Entities
  • Java Numeric Promotion of Primitive Types
    • Java Unary Numeric Promotion
    • Java Binary Numeric Promotion
    • Java Special Cases for Conditional Operators
  • Java Wrapper Classes
  • Java Autoboxing and Unboxing
    • Java Autoboxing
    • Java Unboxing
  1. Java Reference Types
  • Comparing Java Reference Types to Java Primitive Types
  • Java Default Values
    • Java Instance Variable and Java Local Variable Objects
  • Java Arrays
  • Conversion of Java Reference Types
    • Java Widening Conversions
    • Java Narrowing Conversions
  • Converting Between Java Primitives and Java Reference Types
  • Passing Java Reference Types into Java Methods
  • Comparing Java Reference Types Using the Java Equality Operators
    • Using the Java equals() Method
    • Comparing Java Strings
    • Comparing Java Enumerations
  • Copying Java Reference Types
    • Copying a Java Reference to an Java Object
    • Cloning Java Objects
      • Shallow and deep cloning of Java objects
  • Java Memory Allocation and Java Garbage Collection of Java Reference Types
  1. Java Object-Oriented Programming
  • Java Classes and Java Objects
    • Java Class Syntax
    • Instantiating a Java Class (Creating a Java Object)
    • Java Data Members and Java Methods
    • Accessing Java Data Members and Java Methods in Java Objects
    • Java Overloading
    • Java Overriding
    • Java Constructors
    • Java Superclasses and Java Subclasses
    • The Java this Keyword
  • Java Variable-Length Argument Lists
  • Java Abstract Classes and Java Abstract Methods
    • Java Abstract Classes
    • Java Abstract Methods
  • Java Static Data Members, Java Static Methods, Java Static Constants, and Java Static Initializers
    • Java Static Data Members
    • Java Static Methods
    • Java Static Constants
    • Java Static Initializers
  • Java Interfaces
  • Java Enumerations
  • Java Annotation Types
    • Built-in Java Annotations
    • Developer-Defined Java Annotations
  • Functional Java Interfaces
  1. Java Statements and Blocks
  • Java Expression Statements
  • Java Empty Statement
  • Java Blocks
  • Java Conditional Statements
    • The Java if Statement
    • The Java if else Statement
    • The Java if else if Statement
    • The Java switch Statement
  • Java Iteration Statements
    • The Java for Loop
    • The Java Enhanced for Loop
    • The Java while Loop
    • The Java do while Loop
  • Java Transfer of Control
    • The Java break Statement
    • The Java continue Statement
    • The Java return Statement
  • Java Synchronized Statement
  • Java Assert Statement
  • Java Exception Handling Statements
  1. Java Exception Handling
  • The Java Exception Hierarchy
  • Java Checked Exceptions and Java Unchecked Exceptions and Java Errors
    • Java Checked Exceptions
    • Java Unchecked Exceptions
    • Java Errors
  • Common Java Checked/Unchecked Exceptions and Java Errors
    • Common Java Checked Exceptions
    • Common Java Unchecked Exceptions
    • Common Java Errors
  • Java Exception Handling Keywords
    • The Java throw Keyword
    • The Java try/catch/finally Keywords
    • The Java try-catch Statement
    • The Java try-finally Statement
    • The Java try-catch-finally Statement
    • The Java try-with-resources Statement
    • The Java multi-catch Clause
  • The Java Exception Handling Process
  • Defining Your Own Java Exception Class
  • Printing Information About Java Exceptions
    • The Java getMessage() Method
    • The Java toString() Method
    • The Java printStackTrace() Method
  1. Java Modifiers
  • Java Access Modifiers
  • Other Java (Nonaccess) Modifiers
  • Java Modifiers Encoding

II. Platform

  1. Java Platform, Standard Edition Common Java SE API Libraries Language and Utility Libraries

Base Libraries

Integration Libraries

Miscellaneous User Interface Libraries

JavaFX User Interface Library

Remote Method Invocation (RMI) and CORBA Libraries

Security Libraries

Extensible Markup Language (XML) Libraries

  1. Development Basics Java Runtime Environment

Java Development Kit

Java Program Structure

Command-Line Tools Java Compiler

Java Interpreter

Java Program Packager

JAR File Execution

Classpath

  1. Memory Management Garbage Collectors Serial Collector

Parallel Collector

Parallel Compacting Collector

Concurrent Mark-Sweep Collector

Garbage-First (G1) Collector

Memory Management Tools

Command-Line Options

Resizing the JVM Heap

Metaspace

Interfacing with the GC Explicit Garbage Collection

Finalization

  1. Basic Input and Output Standard Streams in, out, and err

Class Hierarchy for Basic Input and Output

File Reading and Writing Reading Character Data from a File

Reading Binary Data from a File

Writing Character Data to a File

Writing Binary Data to a File

Socket Reading and Writing Reading Character Data from a Socket

Reading Binary Data from a Socket

Writing Character Data to a Socket

Writing Binary Data to a Socket

Serialization Serialize

Deserialize

Zipping and Unzipping Files Compressing and Uncompressing GZIP Files

  1. New I/O API (NIO.2) The Path Interface

The Files Class

Additional Features

  1. Concurrency Creating Threads Extending the Thread Class

Implementing the Runnable Interface

Thread States

Thread Priorities

Common Methods

Synchronization

Concurrent Utilities Executors

Concurrent Collections

Synchronizers

Timing Utility

  1. Java Collections Framework The Collection Interface

Implementations

Collection Framework Methods

Collections Class Algorithms

Algorithm Efficiencies

Comparator Functional Interface

Convenience Factory Methods

  1. Generics Framework Generic Classes and Interfaces

Constructors with Generics

Substitution Principle

Type Parameters, Wildcards, and Bounds

The Get and Put Principle

Generic Specialization

Generic Methods in Raw Types

  1. The Java Scripting API Scripting Languages

Script Engine Implementations Embedding Scripts into Java

Invoking Methods of Scripting Languages

Accessing and Controlling Java Resources from Scripts

Setting Up Scripting Languages and Engines Scripting Language Setup

Scripting Engine Setup

Scripting Engine Validation

  1. Date and Time API Legacy Interoperability

Regional Calendars

ISO Calendar Machine Interface

Durations and Periods

JDBC and XSD Mapping

Formatting

  1. Lambda Expressions λEs Basics λEs Syntax and Example

Method and Constructor References

Specific-Purpose Functional Interfaces

General-Purpose Functional Interfaces

Resources for λEs Tutorials

Community Resources

  1. JShell: the Java Shell Getting Started

Snippets Modifiers

Flow Control Statements

Package Declarations

Using JShell Primary Expressions

Dependencies

Statements and Code Blocks

Method and Class Declarations

Viewing, Deleting, and Modifying Snippets

Saving, Loading, and State

JShell Features Scratch Variables

Tab Auto-Complete

Forward Referencing

Checked Exceptions

Hierarchy and Scope

Summary of JShell Commands

  1. Java Module System Project Jigsaw

Java Modules Automatic Modules

Unnamed Modules

Accessibility

Compiling Modules

Modular JDK

jdeps Identifying Dependencies

Identifying Undocumented JDK Internal Dependencies

Defining a Module

Exporting a Package

Declaring Dependencies

Transitive Dependencies

Defining Service Providers Defining Service API

Implementing Service API

Using Service Providers

jlink

III. Appendixes

A. Fluent APIs

B. Third-Party Tools Development, CM, and Test Tools

Libraries

Integrated Development Environments

Web Application Platforms

Scripting Languages Compatible with JSR-223

C. UML Basics Class Diagrams Name

Attributes

Operations

Visibility

Object Diagrams

Graphical Icon Representation Classes, Abstract Classes, and Interfaces

Notes

Packages

Connectors

Multiplicity Indicators

Role Names

Class Relationships Association

Direct Association

Composition Association

Aggregation Association

Temporary Association

Generalization

Realization

Sequence Diagrams Participant (1)

Found Message (2)

Synchronous Message (3)

Return Call (4)

Asynchronous Message (5)

Message to Self (6)

Lifeline (7)

Activation Bar (8)

Index

Sources:

Fair Use Sources:

Categories
Bibliography Java Software Engineering

Java in a Nutshell – A Desktop Quick Reference

See also Java Programming Language, Java Glossary, Java Bibliography, Java Reference materials

Java in a Nutshell – A Desktop Quick Reference, 7th Edition, by Ben Evans and David Flanagan, 2018, B07L3BFG49 (JvNutSh)

Fair Use Source: B07L3BFG49 (JvNutSh)

About This Book:

This updated edition of Java in a Nutshell not only helps experienced Java programmers get the most out of Java versions 9 through 11, it’s also a learning path for new developers. Chock full of examples that demonstrate how to take complete advantage of modern Java APIs and development best practices, this thoroughly revised book includes new material on Java Concurrency Utilities.

The book’s first section provides a fast-paced, no-fluff introduction to the Java programming language and the core runtime aspects of the Java platform. The second section is a reference to core concepts and APIs that explains how to perform real programming work in the Java environment.

  • Get up to speed on language details, including Java 9-11 changes
  • Learn object-oriented programming, using basic Java syntax
  • Explore generics, enumerations, annotations, and lambda expressions
  • Understand basic techniques used in object-oriented design
  • Examine concurrency and memory, and how they’re intertwined
  • Work with Java collections and handle common data formats
  • Delve into Java’s latest I/O APIs, including asynchronous channels
  • Use Nashorn to execute JavaScript on the Java Virtual Machine
  • Become familiar with development tools in OpenJDK

About the Authors:

Ben Evans is an author, speaker, consultant and educator. He is co-founder of jClarity, a startup which delivers performance tools & services to help development & ops teams. He helps to organize the London Java Community and serves on the Java Community Process Executive Committee, helping define standards for the Java ecosystem. He is a Java Champion, JavaOne Rockstar Speaker and a Java Editor at InfoQ. Ben travels frequently and speaks regularly, all over the world.

David Flanagan is a computer programmer who spends most of his time writing about JavaScript and Java. His books with O’Reilly include Java in a Nutshell, Java Examples in a Nutshell, Java Foundation Classes in a Nutshell, JavaScript: The Definitive Guide, and JavaScript Pocket Reference. David has a degree in computer science and engineering from the Massachusetts Institute of Technology. He lives with his wife and children in the U.S. Pacific Northwest bewteen the cities of Seattle, Washington and Vancouver, British Columbia. David has a blog at www.davidflanagan.com.

Book Details:

  • ASIN : B07L3BFG49
  • Publisher : O’Reilly Media; 7th edition (December 3, 2018)
  • Publication date : December 3, 2018
  • Print length : 760 pages

Table of Contents:

Sources:

Fair Use Sources:

Categories
Artificial Intelligence AWS Azure Bibliography C# .NET Cloud Data Science - Big Data DevOps DevSecOps-Security-Privacy GCP Go Programming Language Java JavaScript Kotlin Kubernetes Linux Networking Operating Systems PowerShell Python React Software Engineering Spring Framework Swift TypeScript Vue.js Framework

Manning Publications

See also Java Bibliography, JavaScript Bibliography, Python Bibliography

Manning publishes the best quality IT books in the industry.

Manning is an independent publisher, providing computer books for software developers, engineers, architects, system administrators, and managers. Our books also cover topics for young programmers, students, and occasionally children.

summary

Manning is an independent publisher of computer books and video courses for software developers, engineers, architects, system administrators, managers and all who are professionally involved with the computer business. We also publish for students and young programmers, including occasionally for children. We are an entirely virtual organization based on Shelter Island, New York, with many staff working from far-flung places like Manila and Zagreb.

company character

“Independent” means we are not owned by a large corporate entity and are free to make decisions without bureaucratic overhead. That has allowed us to innovate and be flexible and to quickly adjust what we do as we go. We were the first by several years to sell our books as unprotected PDFs, something that later became commonplace. We were the first to start selling books before they were finished, in the Manning Early Access Program. This gave our readers access to our content as soon as it was readable, and this too has become common in the industry. And it means we are thinking every day about new ways to satisfy our customers, some of which we hope you will be pleased to discover in the not-too-distant future.

how we improve

We published our first book in 1993 and have been learning from our successes, and even more from our mistakes, ever since. Every new book teaches us something that helps us improve:

  • How to choose the topics we publish on
  • How to find the right authors for each book
  • How to help authors write the best books they can
  • How to ensure the content is valuable and easy to learn
  • How to let readers know about our content

book series

We publish standalone titles as well as the following book series:

  • Hello!
  • In Action
  • In Practice
  • In Depth
  • In a Month of Lunches

availability

Readers can access our books through the Manning Early Access Program, O’Reilly Learning (formerly Safari Books Online), and iBooks. Print copies, wherever they are bought, come with free electronic versions in PDF, ePub and Kindle formats. With your print copy in hand, register it on the Manning site and you can download the digital versions from your account.

At this time, our eBooks are available only from Manning.com and Apple’s iBookstore.

https://www.manning.com/manning

Sources:

Fair Use Sources: