You can read Chapter 12 of Core Java Fundamentals by signing up for a free Safari Books Online trail at https://www.safaribooksonline.com/home/ (no credit card is needed to sign up). Then search on "9780135167199" (make sure you click on the 11th Edition).
Here is a direct link to Chapter 12: https://www.safaribooksonline.com/library/view/core-java-volume/9780135167199/chapter12.xhtml#chapter12
I've added additional comments and formatting to the code examples to help make them easier to follow and understand.
NOTE: You will need Java 10 or higher to compile and run the examples, as the examples use newer Java language features.