Software Development

Level: Intermediate

Mastering Intermediate Java: From Syntax to Concurrency

3 days

This comprehensive intermediate-level Java course is designed to take your Java programming skills to the next level. Building upon your existing knowledge of Java basics, this course will dive deep into advanced language features, functional programming concepts, and practical applications of Java in modern software development. A significant focus will be placed on mastering the Stream API, a powerful tool for processing collections of data efficiently and in a functional style.

Learning Outcomes

By the end of this course, participants will be able to:

  • Utilise advanced Java syntax and features effectively
  • Implement and work with generic types and methods
  • Apply functional programming concepts in Java
  • Leverage the Stream API for efficient and expressive data processing
  • Handle exceptions effectively and implement robust logging
  • Work with the modern Java Date/Time API
  • Understand and implement multi-threading in Java applications

Course Outline

Module 1: Review of Java Syntax

  • Classes and inheritance: structure, principles, and advanced techniques
  • Packages: structure, naming conventions, and effective usage
  • Collection APIs: overview of Java Collections Framework and choosing appropriate collections

Module 2: Advanced Java Features

  • Nested classes: static nested classes, inner classes, local and anonymous classes
  • Default methods in interfaces: implementation and overriding
  • Using Optional for improved null-safety and best practices

Module 3: Generics

  • Creating and using generic types, classes, and interfaces
  • Implementing generic methods and understanding type variable bounds
  • Type erasure, inheritance with generics, and co/contra-variance concepts

Module 4: Functional Programming Concepts

  • Functional interfaces: built-in options and creating custom interfaces
  • Lambdas: syntax, usage, and method references
  • Higher order functions, working with immutable data, and understanding closures

Module 5: Stream API

  • Introduction to Streams: concept, sources, and operations
  • Relationship between streams and collections, including conversions
  • Filtering streams with predicates and building complex operations with pipelines
  • Terminal and intermediate operations in stream processing

Module 6: Effective Exception Handling

  • Resource handling with try-with-resources and the AutoCloseable interface
  • Managing exceptions in lambda expressions and functional interfaces
  • Introduction to the Try monad concept for exceptionless programming

Module 7: Logging

  • Overview of logging frameworks (e.g., SLF4J, Log4j) and their configuration
  • Best practices for effective logging, including appropriate use of log levels
  • Proper handling and logging of exceptions

Module 8: Date/Time API

  • Limitations of old Date/Time APIs and introduction to the java.time package
  • Working with LocalDate, LocalTime, LocalDateTime, Instant, Period, and Duration
  • Date and time arithmetic, formatting, parsing, and handling time zones

Module 9: Java Threading

  • Thread basics: creation, starting, and understanding states and lifecycle
  • Synchronisation techniques: synchronized keyword, methods, and lock objects
  • Concurrency utilities: Executors, thread pools, Callable, and Future
  • Thread communication, safety, and best practices for avoiding common pitfalls

Conclusion and Next Steps

  • Recap of key concepts, best practices for efficient Java coding
  • Resources for continued learning and staying current with Java developments