The Java Workshop By Packtpub
What's Inside
From A to Z, we've got you covered!
·
Workshop Onboarding
o Welcome to
The Java Workshop
o Installation
and Setup
o Credits
·
1. Getting Started
o Overview
o Writing,
Compiling, and Executing Your Hello World Program
o Exercise 1:
Creating Your Hello World Program in Java
o Exercise 1:
Creating Your Hello World Program in Java
o Basic Syntax
and Naming Conventions
o Exercise 2:
Printing Different Types of Data
o Exercise 2:
Printing Different Types of Data
o Primitive
versus Reference Data Types
o Exercise 3:
Declaring Strings
o Exercise 3:
Declaring Strings
o Doing Some
Math
o Exercise 4:
Solving a Simple Trigonometry Problem
o Exercise 4:
Solving a Simple Trigonometry Problem
o Comments Help
You to Share Code
o Exercise 5:
Running the Code from the CLI
o Exercise 5:
Running the Code from the CLI
o Activity 1:
Obtaining the Minimum of Two Numbers
o Summary
·
2. Learning the Basics
o Overview
o Controlling
the Flow of Your Programs
o Exercise 1:
Creating a Basic if Statement
o Exercise 1:
Creating a Basic if Statement
o Comparison
Operators
o Exercise 2:
Using Java Comparison Operators
o Exercise 2:
Using Java Comparison Operators
o Exercise 3:
Implementing a Nested if Statement
o Exercise 3:
Implementing a Nested if Statement
o Exercise 4:
Using if and else Statements
o Exercise 4:
Using if and else Statements
o Using Complex
Conditionals
o Exercise 5:
Using Logical Operators to Create Complex Conditionals
o Exercise 5: Using
Logical Operators to Create Complex Conditionals
o Using
Arithmetic Operators in an if Condition
o Exercise 6:
Using the Ternary Operator
o Exercise 6: Using
the Ternary Operator
o Exercise 7:
Comparing Decimal Values
o Exercise 7:
Comparing Decimal Values
o Comparing
Strings
o Exercise 8:
Using switch
o Exercise 8:
Using switch
o Exercise 9:
Allowing Cases to Fall Through
o Exercise 9:
Allowing Cases to Fall Through
o Using Java 12
Enhanced Switch Statements
o Exercise 10:
Using Java 12 Switch Statements
o Exercise 10:
Using Java 12 Switch Statements
o Looping and
Performing Repetitive Tasks
o Exercise 11:
Using a Classic for Loop
o Exercise 11:
Using a Classic for Loop
o Exercise 12:
Using an Enhanced for Loop
o Exercise 12:
Using an Enhanced for Loop
o Exercise 13:
Using break and continue
o Exercise 13:
Using break and continue
o Exercise 14:
Using a while Loop
o Exercise 14:
Using a while Loop
o Using the
do-while Loop
o Exercise 15:
Testing Command-Line Arguments
o Exercise 15:
Testing Command-Line Arguments
o Exercise 16:
Converting String to Integers and Doubles
o Exercise 16:
Converting String to Integers and Doubles
o Diving Deeper
into Variables – Immutability
o Activity 1:
Taking Input and Comparing Ranges
o Summary
·
3. Object-Oriented Programming
o Overview
o Working with
Objects in Java
o Checking the
Precedence of a Class with instanceof
o Exercise 1:
Creating the WordTool Class
o Exercise 1:
Creating the WordTool Class
o Activity 1: Adding
the Frequency-of-Symbol Calculation to WordTool
o Inheritance
in Java
o Overriding
and Hiding Methods
o Overloading
Methods and Constructors
o Recursion
o Annotations
o Interfaces
o Inner Classes
o Documenting
with JavaDoc
o Activity 2:
Adding Documentation to WordTool
o Summary
·
4. Collections, Lists, and Java's Built-In APIs
o Overview
o Arrays
o Activity 1:
Searching for Multiple Occurrences in an Array
o Sets
o Lists
o Exercise 1:
Creating the AnalyzeInput Application
o Exercise 1:
Creating the AnalyzeInput Application
o Maps
o Iterating
through Collections
o Exercise 2:
Bringing Analytics into the AnalyzeInput Application
o Exercise 2:
Bringing Analytics into the AnalyzeInput Application
o Sorting
Collections
o Exercise 3:
Sort the Results from the AnalyzeInput Application
o Exercise 3:
Sort the Results from the AnalyzeInput Application
o Properties
o Activity 2:
Iterating through Large Lists
o Summary
o Survey 1
·
5. Exceptions
o Overview
o A Simple
Exception Example
o NullPointerException
– Have No Fear
o Catching
Exceptions
o Exercise 1:
Logging Exceptions
o Exercise 1:
Logging Exceptions
o Throws and
Throw
o Exercise 2:
Breaking the Law (and Fixing it)
o Exercise 2:
Breaking the Law (and Fixing it)
o The finally
Block
o Activity 1:
Designing an Exception Class Logging Data
o Best
Practices for Handling Exceptions
o Where Do
Exceptions Come From?
o Summary
·
6. Libraries, Packages, and Modules
o Overview
o Organizing
Code into Packages
o Exercise 1:
Importing Classes
o Exercise 1:
Importing Classes
o Fully Qualified
Class Names
o Exercise 2:
Creating a Package for a Fitness Tracking App
o Exercise 2:
Creating a Package for a Fitness Tracking App
o Exercise 3:
Building a JAR File
o Exercise 3:
Building a JAR File
o Exercise 4:
Building an Executable JAR File
o Exercise 4:
Building an Executable JAR File
o Build Tools
o Exercise 5:
Creating a Maven Project
o Exercise 5:
Creating a Maven Project
o Exercise 6:
Adding Java Sources to the Maven Project
o Exercise 6:
Adding Java Sources to the Maven Project
o Exercise 7:
Building the Maven Project
o Exercise 7:
Building the Maven Project
o Exercise 8:
Creating an Executable JAR with Maven
o Exercise 8:
Creating an Executable JAR with Maven
o Exercise 9:
Creating a Gradle Project
o Exercise 9:
Creating a Gradle Project
o Exercise 10:
Building an Executable JAR with Gradle
o Exercise 10:
Building an Executable JAR with Gradle
o Using
Third-Party Libraries
o Exercise 11:
Adding a Third-Party Library Dependency
o Exercise 11:
Adding a Third-Party Library Dependency
o Exercise 12:
Using the Apache Commons Lang Library
o Exercise 12:
Using the Apache Commons Lang Library
o Using Modules
o Exercise 13:
Creating a Project for a Module
o Exercise 13:
Creating a Project for a Module
o Exercise 14:
Creating a Second Module Using the First One
o Exercise 14:
Creating a Second Module Using the First One
o Activity 1:
Tracking Summer High Temperatures
o Summary
·
7. Databases and JDBC
o Overview
o Relational
Databases
o Relational
Database Management Systems
o Exercise 1:
Running the H2 Database
o Exercise 1:
Running the H2 Database
o Exercise 2:
Creating the Customer Table
o Exercise 2:
Creating the Customer Table
o Exercise 3:
Inserting Data
o Exercise 3:
Inserting Data
o Retrieving Data
o Exercise 4:
Creating the email Table
o Exercise 4:
Creating the email Table
o Selecting
Data from Multiple Tables
o Exercise 5:
Modifying email Data
o Exercise 5:
Modifying email Data
o Deleting Data
o Exercise 6:
Querying Data with JDBC
o Exercise 6:
Querying Data with JDBC
o Sanitizing
User Input
o Exercise 7:
Using Prepared Statements with Transactions
o Exercise 7:
Using Prepared Statements with Transactions
o Simplifying
JDBC Programming
o Activity 1:
Track Your Progress
o Summary
·
8. Sockets, Files, and Streams
o Overview
o Listing Files
and Directories
o Exercise 1:
Listing the Contents of Subdirectories
o Exercise 1:
Listing the Contents of Subdirectories
o Creating and
Writing to a File
o Activity 1:
Writing the Directory Structure to a File
o Reading an
Existing File
o Reading a
Properties File
o Exercise 2:
Creating a Properties File from the CLI
o Exercise 2:
Creating a Properties File from the CLI
o What Are
Streams?
o Activity 2:
Improving the EchoServer and EchoClient Programs
o Blocking and
Non-Blocking Calls
o Summary
·
9. Working with HTTP
o Overview
o Exploring HTTP
o Using
HttpUrlConnection
o Exercise 1:
Creating a HEAD Request
o Exercise 1:
Creating a HEAD Request
o Exercise 2:
Creating a GET Request
o Exercise 2:
Creating a GET Request
o Dealing with
Slow Connections
o Exercise 3:
Sending JSON Data with POST Requests
o Exercise 3:
Sending JSON Data with POST Requests
o Parsing HTML
Data
o Exercise 4:
Using jsoup to Extract Data from HTML
o Exercise 4:
Using jsoup to Extract Data from HTML
o Delving into
the java.net.http Module
o Exercise 5:
Getting HTML Contents Using the java.net.http Module
o Exercise 5:
Getting HTML Contents Using the java.net.http Module
o Activity 1:
Using the jsoup Library to Download Files from the Web
o Summary
o Survey 2
·
10. Encryption
o Overview
o Exercise 1:
Encrypting the String using Advanced Encryption Standard
o Exercise 1:
Encrypting the String using Advanced Encryption Standard
o Block Ciphers
o Exercise 2:
Encrypting the String Using the RSA Asymmetric
o Exercise 2:
Encrypting the String Using the RSA Asymmetric
o Exercise 3:
Encrypting a File
o Exercise 3:
Encrypting a File
o Summary
·
11. Processes
o Overview
o Launching a
Process
o Capturing the
Output of a Child Process
o Storing the
Output of a Child Process in a File
o Activity 1:
Making a Parent Process to Launch a Child Process
o Summary
·
12. Regular Expressions
o Overview
o Decrypting
Regular Expressions
o Exercise 1:
Implementing Regular Expressions
o Exercise 1:
Implementing Regular Expressions
o Activity 1:
Regular Expressions to Check if the Entrance is Entered in the Desired Format
o Regular
Expressions in Java
o Exercise 2:
Extracting the Domain Using Pattern
o Exercise 2:
Extracting the Domain Using Pattern
o Exercise 3:
Extracting Links Using Pattern Matching
o Exercise 3:
Extracting Links Using Pattern Matching
o Summary
·
13. Functional Programming with Lambda Expressions
o Overview
o Functional
Programming
o Exercise 1: Writing
Pure Functions
o Exercise 1:
Writing Pure Functions
o Exercise 2:
Creating an Immutable Class
o Exercise 2:
Creating an Immutable Class
o Activity 1:
Modifying Immutable Lists
o Immutable
Collections
o Exercise 3:
Overriding the String Method
o Exercise 3:
Overriding the String Method
o Lambda
Expressions
o Exercise 4:
Listing the Spare Tires
o Exercise 4:
Listing the Spare Tires
o Summary
·
14. Recursion
o Overview
o Exercise 1:
Using Recursion to Overflow the Stack
o Exercise 1:
Using Recursion to Overflow the Stack
o Exercise 2:
Using Recursion to Calculate Factorials
o Exercise 2:
Using Recursion to Calculate Factorials
o Processing an
XML Document
o Exercise 3:
Creating an XML File
o Exercise 3:
Creating an XML File
o Introducing
the DOM XML API
o Exercise 4:
Traversing an XML Document
o Exercise 4:
Traversing an XML Document
o Activity 1:
Calculating the Fibonacci Sequence
o Summary
·
15. Processing Data with Streams
o Overview
o Creating
Streams
o Intermediate
Operations
o Exercise 1:
Using the Stream API
o Exercise 1:
Using the Stream API
o Activity 1:
Apply Discount on the Items
o Using
Collectors
o Exercise 2:
Converting CSV to a List
o Exercise 2:
Converting CSV to a List
o Activity 2:
Searching for Specifics
o Summary
o Survey 3
·
16. Predicates and Other Functional Interfaces
o Overview
o Exercise 1:
Defining a Predicate
o Exercise 1:
Defining a Predicate
o Activity 1:
Toggling the Sensor States
o Exercise 2:
Producing Side Effects
o Exercise 2:
Producing Side Effects
o Function
o Exercise 3:
Extracting Data
o Exercise 3:
Extracting Data
o Activity 2:
Using a Recursive Function
o Activity 3:
Using a Lambda Function
o Summary
·
17. Reactive Programming with Java Flow
o Overview
o Publisher
o Subscriber
o Exercise 1: A
Simple Application with a Single Publisher and a Single Subscriber
o Exercise 1: A
Simple Application with a Single Publisher and a Single Subscriber
o Exercise 2:
Using a Processor to Convert a Stream of Strings to Numbers
o Exercise 2:
Using a Processor to Convert a Stream of Strings to Numbers
o Activity 1:
Let NumberProcessor Format Values as Integers
o Summary
·
18. Unit Testing
o Overview
o Getting
Started with Unit Tests
o Exercise 1:
Writing a First Unit Test
o Exercise 1:
Writing a First Unit Test
o Exercise 2:
Writing a Successful Test
o Exercise 2:
Writing a Successful Test
o Deciding What
to Test
o Exercise 3:
Writing a Parameterized Test
o Exercise 3:
Writing a Parameterized Test
o When Tests
Won't Work – Disabling Tests
o Exercise 4:
Using Test Setup and Cleanup Methods
o Exercise 4:
Using Test Setup and Cleanup Methods
o Mocking
o Exercise 5:
Using Mocks when Testing
o Exercise 5:
Using Mocks when Testing
o Activity:
Counting the Words in the String
o Summary
·
Activity Solutions
o Chapter 1 -
Activity 1: Obtaining the Minimum of Two Numbers
o Chapter 1 -
Activity 1: Obtaining the Minimum of Two Numbers
o Chapter 2 -
Activity 1: Taking Input and Comparing Ranges
o Chapter 2 -
Activity 1: Taking Input and Comparing Ranges
o Chapter 3 -
Activity 1: Adding the Frequency-of-Symbol Calculation to WordTool
o Chapter 3 -
Activity 1: Adding the Frequency-of-Symbol Calculation to WordTool
o Chapter 3 -
Activity 2: Adding Documentation to WordTool
o Chapter 3 -
Activity 2: Adding Documentation to WordTool
o Chapter 4 -
Activity 1: Searching for Multiple Occurrences in an Array
o Chapter 4 -
Activity 1: Searching for Multiple Occurrences in an Array
o Chapter 4 -
Activity 2: Iterating through Large Lists
o Chapter 4 -
Activity 2: Iterating through Large Lists
o Chapter 5 -
Activity 1: Designing an Exception Class Logging Data
o Chapter 5 -
Activity 1: Designing an Exception Class Logging Data
o Chapter 6:
Activity 1: Tracking Summer High Temperatures
o Chapter 6:
Activity 1: Tracking Summer High Temperatures
o Chapter 7 -
Activity 1: Track Your Progress
o Chapter 7 -
Activity 1: Track Your Progress
o Chapter 8 -
Activity 1: Writing the Directory Structure to a File
o Chapter 8 -
Activity 1: Writing the Directory Structure to a File
o Chapter 8 -
Activity 2: Improving the EchoServer and EchoClient Programs
o Chapter 8 -
Activity 2: Improving the EchoServer and EchoClient Programs
o Chapter 9 -
Activity 1: Using the jsoup Library to Download Files from the Web
o Chapter 9 -
Activity 1: Using the jsoup Library to Download Files from the Web
o Chapter 11 -
Activity 1: Making a Parent Process to Launch a Child Process
o Chapter 11 -
Activity 1: Making a Parent Process to Launch a Child Process
o Chapter 12 -
Activity 1: Regular Expressions to Check if the Entrance is Entered in the
Desired Format
o Chapter 12 -
Activity 1: Regular Expressions to Check if the Entrance is Entered in the
Desired Format
o Chapter 13 -
Activity 1: Modifying Immutable Lists
o Chapter 13 -
Activity 1: Modifying Immutable Lists
o Chapter 14 -
Activity 1: Calculating the Fibonacci Sequence
o Chapter 14 -
Activity 1: Calculating the Fibonacci Sequence
o Chapter 15 -
Activity 1: Apply Discount on the Items
o Chapter 15 -
Activity 1: Apply Discount on the Items
o Chapter 15 -
Activity 2: Searching for Specifics
o Chapter 15 -
Activity 2: Searching for Specifics
o Chapter 16 -
Activity 1: Toggling the Sensor States
o Chapter 16 -
Activity 1: Toggling the Sensor States
o Chapter 16 -
Activity 2: Using a Recursive Function
o Chapter 16 -
Activity 2: Using a Recursive Function
o Chapter 16 -
Activity 3: Using a Lambda Function
o Chapter 16 -
Activity 3: Using a Lambda Function
o Chapter 17 -
Activity 1: Let NumberProcessor Format Values as Integers
o Chapter 17 -
Activity 1: Let NumberProcessor Format Values as Integers
o Chapter 18 -
Activity 1: Counting the Words in the String
o Chapter 18 -
Activity 1: Counting the Words in the String
Comments
Post a Comment
If you have any doubts, please let me know