Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright and Credits
Java 11 Cookbook Second Edition
Packt Upsell
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Reviews
Installation and a Sneak Peek into Java 11
Introduction
Installing JDK 18.9 on Windows and setting up the PATH variable
How to do it...
Installing JDK 18.9 on Linux (Ubuntu, x64) and configuring the PATH variable
How to do it...
Compiling and running a Java application
Getting ready
How to do it...
What's new in Java 11?
Getting ready
How to do it...
JEP 318 – Epsilon
JEP 321 – HTTP Client (Standard)
JEP 323 – Local-Variable Syntax for Lambda Parameters
JEP 333 – ZGC
New API
There's more...
Using application class-data sharing
Getting ready
How to do it...
Fast Track to OOP - Classes and Interfaces
Introduction
Implementing object-oriented design (OOD)
Getting ready
How to do it...
How it works...
There's more...
Using inner classes
Getting ready
How to do it...
How it works...
There's more...
Using inheritance and aggregation
Getting ready
How to do it...
How it works...
Aggregation makes the design more extensible
Coding to an interface
Getting ready
How to do it...
How it works...
There's more...
Creating interfaces with default and static methods
Getting ready
How to do it...
How it works...
Creating interfaces with private methods
Getting ready
How to do it...
How it works...
There's more...
A better way to work with nulls using Optional
Getting ready
How to do it...
How it works...
There's more...
Using the utility class Objects
Getting ready
How to do it...
How it works...
Modular Programming
Introduction
Using jdeps to find dependencies in a Java application
Getting ready
How to do it...
How it works...
There's more...
Creating a simple modular application
Getting ready
How to do it...
How it works...
See also
Creating a modular JAR
Getting ready
How to do it...
Using a module JAR with pre-Project Jigsaw JDK applications
Getting ready
How to do it...
Bottom-up migration
Getting ready
How to do it...
Modularizing banking.util.jar
Modularizing math.util.jar
Modularizing calculator.jar
How it works...
Top-down migration
Getting ready
How to do it...
Modularizing the calculator
Modularizing banking.util
Modularizing math.util
Using services to create loose coupling between the consumer and provider modules
Getting ready
How to do it...
Creating a custom modular runtime image using jlink
Getting ready
How to do it...
Compiling for older platform versions
Getting ready
How to do it...
How it works...
Creating multi-release JARs
How to do it...
How it works...
Using Maven to develop a modular application
Getting ready
How to do it...
Making your library module-path-friendly
Getting ready
How to do it...
How it works...
There's more... 
How to open a module for reflection
Getting ready
How to do it...
How it works...
Going Functional
Introduction
Using standard functional interfaces
Getting ready
How to do it...
How it works...
There's more...
Creating a functional interface
Getting ready
How to do it...
How it works...
There's more...
Understanding lambda expressions
Getting ready
How to do it...
How it works...
There's more...
Using lambda expressions
Getting ready
How to do it...
How it works...
There's more...
Using method references
Getting ready
How to do it...
Static unbound method reference
Non-static bound method reference
Non-static unbound method reference
Constructor method references
There's more...
Leveraging lambda expressions in your programs
Getting ready
How to do it...
There's more...
Streams and Pipelines
Introduction
Creating immutable collections using the of() and copyOf() factory methods
Getting ready
How to do it...
There's more...
Creating and operating on streams
Getting ready
How to do it...
How it works...
Using numeric streams for arithmetic operations
Getting ready
How to do it...
There's more...
Completing streams by producing collections
Getting ready
How to do it...
Completing streams by producing maps
Getting ready
How to do it...
Completing streams by producing maps using grouping collectors
Getting ready
How to do it...
There's more...
Creating stream operation pipeline
Getting ready
How to do it...
There's more...
Processing streams in parallel
Getting ready
How to do it...
Database Programming
Introduction
Connecting to a database using JDBC
How to do it...
How it works...
There's more...
Setting up the tables required for DB interactions
Getting ready
How it works...
There's more...
Performing CRUD operations using JDBC
Getting ready
How to do it...
There's more...
Using the Hikari Connection Pool (HikariCP)
Getting ready
How to do it...
How it works...
There's more...
Using prepared statements
Getting ready
How to do it...
There's more...
Using transactions
Getting ready
How to do it...
There's more...
Working with large objects
Getting ready
How to do it...
There's more...
Executing stored procedures
Getting ready
How to do it...
There's more...
Using batch operations for a large set of data
Getting ready
How to do it...
How it works...
There's more...
Using MyBatis for CRUD operations
Getting ready
How to do it...
How it works...
There's more...
Using the Java Persistence API and Hibernate
Getting ready
How to do it...
How it works...
Concurrent and Multithreaded Programming
Introduction
Using the basic element of concurrency – thread
Getting ready
How to do it...
There's more...
Different synchronization approaches
Getting ready
How to do it...
There's more...
Immutability as a means of achieving concurrency
Getting ready
How to do it...
There's more...
Using concurrent collections
Getting ready
How to do it...
How it works...
Using the executor service to execute async tasks
Getting ready
How to do it...
How it works...
There's more...
Using fork/join to implement divide-and-conquer
Getting ready
How to do it...
Using flow to implement the publish-subscribe pattern
Getting ready
How to do it...
Better Management of the OS Process
Introduction
Spawning a new process
Getting ready
How to do it...
How it works...
Redirecting the process output and error streams to file
Getting ready
How to do it...
There's more...
Changing the working directory of a subprocess
Getting ready
How to do it...
How it works...
Setting the environment variable for a subprocess
How to do it...
How it works...
Running shell scripts
Getting ready
How to do it...
How it works...
Obtaining the process information of the current JVM
How to do it...
How it works...
Obtaining the process information of the spawned process
Getting ready
How to do it...
Managing the spawned process
How to do it...
Enumerating live processes in the system
How to do it...
Connecting multiple processes using pipe
Getting ready
How to do it...
How it works...
Managing subprocesses
Getting ready
How to do it...
How it works...
RESTful Web Services Using Spring Boot
Introduction
Creating a simple Spring Boot application
Getting ready
How to do it...
How it works...
Interacting with the database
Getting ready
Installing MySQL tools
Creating a sample database
Creating a person table
Populating sample data
How to do it...
How it works...
Creating a RESTful web service
Getting ready
How to do it...
How it works...
Creating multiple profiles for Spring Boot
Getting ready
How to do it...
How it works...
There's more...
Deploying RESTful web services to Heroku
Getting ready 
Setting up a Heroku account
Creating a new app from the UI
Creating a new app from the CLI
How to do it...
There's more...
Containerizing the RESTful web service using Docker
Getting ready
How to do it...
How it works...
Monitoring the Spring Boot 2 application using Micrometer and Prometheus
Getting ready
How to do it...
How it works...
There's more
Networking
Introduction
Making an HTTP GET request
How to do it...
How it works...
Making an HTTP POST request
How to do it...
Making an HTTP request for a protected resource
How to do it...
How it works...
Making an asynchronous HTTP request
How to do it...
Making an HTTP request using Apache HttpClient
Getting ready
How to do it...
There's more...
Making an HTTP request using the Unirest HTTP client library
Getting ready
How to do it...
There's more...
Memory Management and Debugging
Introduction
Understanding the G1 garbage collector
Getting ready
How to do it...
How it works...
Unified logging for JVM
Getting ready
How to do it...
Using the jcmd command for the JVM
How to do it...
How it works...
Try-with-resources for better resource handling
How to do it...
How it works...
Stack walking for improved debugging
Getting ready
How to do it...
How it works...
Using the memory-aware coding style
How to do it...
Best practices for better memory usage
How to do it...
Understanding Epsilon, a low-overhead garbage collector
How to do it...
The Read-Evaluate-Print Loop (REPL) Using JShell
Introduction
Getting familiar with REPL
Getting ready
How to do it...
How it works...
Navigating JShell and its commands
How to do it...
Evaluating code snippets
How to do it...
There's more...
Object-oriented programming in JShell
How to do it...
Saving and restoring the JShell command history
How to do it...
Using the JShell Java API
How to do it...
How it works...
Working with New Date and Time APIs
Introduction
How to work with time zone-independent date and time instances
Getting ready
How to do it…
How it works…
There's more…
How to construct time zone-dependent time instances
Getting ready
How to do it…
How it works…
There's more…
How to create a date-based period between date instances
Getting ready
How to do it…
How it works…
There's more…
How to create a time-based period between time instances
Getting ready
How to do it…
How it works…
There's more…
How to represent epoch time
Getting ready
How to do it…
How it works…
There's more…
How to manipulate date and time instances
Getting ready
How to do it… 
There's more…
How to compare date and time
Getting ready
How to do it…
There's more…
How to work with different calendar systems
Getting ready
How to do it…
How it works…
There's more…
How to format dates using the DateTimeFormatter
Getting ready
How to do it…
How it works…
Testing
Introduction
Behavioral testing using Cucumber
How to do it...
How it works...
Unit testing of an API using JUnit
Getting ready
How to do it...
How it works...
Unit testing by mocking dependencies
Getting ready
How to do it...
How it works...
There's more...
Using fixtures to populate data for testing
How to do it...
How it works...
Integration testing
Getting ready
How to do it...
How it works...
The New Way of Coding with Java 10 and Java 11
Introduction
Using local-variable type inference
Getting ready
How to do it...
Using local-variable syntax for lambda parameters
Getting ready
How to do it...
GUI Programming Using JavaFX
Introduction
Creating a GUI using JavaFX controls
Getting ready
How to do it...
How it works...
Using the FXML markup to create a GUI
Getting ready
How to do it...
How it works...
Using CSS to the style elements in JavaFX
Getting ready
How to do it...
How it works...
Creating a bar chart
Getting ready
How to do it...
How it works...
Creating a pie chart
Getting ready
How to do it...
How it works...
Embedding HTML in an application
Getting ready
How to do it...
How it works...
There's more...
Embedding media in an application
Getting ready
How to do it...
How it works...
There's more...
Adding effects to controls
Getting ready
How to do it...
How it works...
There's more...
Using the Robot API
Getting ready
How to do it...
How it works...
Other Books You May Enjoy
Leave a review - let other readers know what you think
← Prev
Back
Next →
← Prev
Back
Next →