Intermediate Java™

Summary

Intermediate Java and OO Development is a fast paced course suitable for programmers with some previous experience in working with Java and Object-Oriented (OO) programming (equivalent to taking our [12]Gentle Java course). It includes a short review of basic Java concepts, and then moves on to a comprehensive coverage of more advanced topics in Java and OO programming to provide participants with a strong grounding in using Java in a sophisticated and productive manner.

This course goes well beyond the basics of Java and OO programming and covers important topics such as composition, inheritance, polymorphism, interfaces and exceptions, which are all key to creating well-structured OO systems using Java. After coverage of these important areas, it moves on to more advanced topics such as JDBC (for database access), the Java Collections Framework - including the generics capabilities introduced in Java 5, Java I/O, assertions, inner classes, and the reflection API. Finally it covers useful tools for day-to-day programming such as ant, JUnit and various logging frameworks.

This course covers far more than an introductory course, and provides participants with a comprehensive understanding of how to use Java's advanced capabilities in a more sophisticated manner. It teaches a number of useful techniques that enhance productivity and good system design - which Java programmers may otherwise take years to absorb on their own.

This course is suitable for environments using Java 5, or Java 6. All labs are doable in any of the supported Java environments. The course is fast-paced and interesting. Be prepared to work hard and learn a great deal! The course can be held on-site & customized to fit your needs.

All labs are done with the Eclipse IDE Java EE version, and the lab instructions include detailed directions for using it.

Course Objectives
On completion of this course, the student should be able to
  • Review Java language basics
  • Review using composition and delegation to create objects from other objects
  • Review inheritance and polymorphism
  • Understand interfaces, their importance, and their uses
  • Use interfaces to implement abstraction
  • Understand & use exceptions for error handling
  • Understand the basics of using JDBC, and use it to access databases from Java
  • Use the Java 2 Collections Framework (including use of Java Generics)
  • Understand and use basic I/O streams
  • Understand and use Java assertions
  • Learn how to write and use Inner Classes
  • Be familiar with and use Java reflection
  • Understand and use ant and ant buildfiles
  • Understand test-driven development, and use JUnit for testing Java programs
  • Be familiar with Java logging (especially log4j) and use it in your programming
Length
5 Days

Format
50% hands-on, 50% lecture

Course Outline

  • Session 1: Review - Getting Started
    • Writing and Running Java programs
    • Setting up and Using the Development Environment

  • Session 2: Review - Class and Object
    • Creating classes with fields and methods
    • Encapsulation and access protection
    • Constructors
    • Other Capabilities (Static Members, null, final, Wrapper Classes

  • Session 3: Review - Control Flow, String, and Array
    • Flow of Control
    • Strings
    • Arrays

  • Session 4: Review - Packages
    • Using packages to organize code
    • Using import
    • Creating Packages
    • Package Organization and Classpath
    • LABS:
      • Using Packages to Organize Code

  • Session 5: Composition and Inheritance
    • Using Composition to Deal With Complexity
    • Composition/HAS-A, Delegation
    • Using Inheritance and Polymorphism to share commonality
    • IS-A, extends, Inheriting Features, Overriding Methods, Using Polymorphism
    • Class Object
    • Abstract Classes
    • LABS:
      • (Optional) Working with Composition
      • Using Inheritance to Specialize Classes

  • Session 6: Interfaces
    • Programming by Contract
    • Using Interfaces to Define Types
    • Interfaces and Polymorphism
    • LABS:
      • Using Interfaces to Remove Implementation Dependencies

  • Session 7: Exceptions and Error Handling
    • Exceptions
    • Exception Hierarchy
    • try and catch
    • Handling Exceptions
    • Program Flow with Exceptions
    • Finally
    • LABS:
      • Handle Exceptions
      • Define Exception Class

  • Session 8: JDBC
    • JDBC basics
    • JDBC Architecture
    • Using JDBC drivers & DriverManager
    • Class Connection and connecting to a database
    • Class Statement and executing SQL statements
    • Other statement types
    • Driver types
    • LABS:
      • Connecting to a Database
      • Using JDBC for Queries
      • Interacting with an existing database using JDBC

  • Session 9: Collections and Generics
    • The Collections Framework
    • Collection Interfaces
    • Collection, Set, List, Map, Iterator
    • Generics (Java 5)
    • Processing Items With an Iterator
    • for-each Loop (Java 5)
    • Using ArrayList
    • Using HashMap
    • More About Generics (Inheritance, Wildcards, Assignment
    • LABS:
      • Using Collections

  • Session 10: Additional Java Features
    • Assertions
    • Type-safe Enums
    • Annotations

  • Session 11: I/O Streams
    • Readers and Writers
    • Filter Streams
    • InputStreams and OutputStreams
    • Converting Between Streams and Readers/Writers
    • New I/O (NIO) APIs
    • LABS:
      • Using Java I/O to Read and Write

  • Session 12: Inner Classes
    • Why Use Inner Classes?
    • Named Inner Classes
    • Static Inner Classes
    • Anonymous Inner Classes
    • LABS:
      • Using Named Inner Classes
      • Using Anonymous Inner Classes

  • Session 13: Reflection
    • The class called Class
    • Finding Fields, Methods, and Constructors
    • Accessing Fields, Invoking Methods
    • Examining Arrays
    • LABS:
      • Examining Objects Using Reflection
      • Accessing Fields and Invoking Methods via Reflection

  • Session 14: Introduction to ant
    • ant Overview, Installing and Running ant
    • Buildfiles, Projects, Targets, Tasks, Properties
    • Creating Build Files
    • LABS:
      • Running ant
      • Creating and Using Buildfiles
      • Using Basic ant Tasks

  • Session 15: Working with Paths and Resource Collections
    • Paths(e.g. CLASSPATH, PATH)
    • Resource Collections - FileSets, DirSets, Files, PatternSets
    • Other Resource Collections and Selectors
    • LABS:
      • Working with Paths
      • Using Resource Collections

  • Session 16: ant Tasks
    • Overview of ant Tasks
    • and Tasks in Depth
    • Creating Java Archives - , ,
    • File Related Tasks, Other Useful Tasks
    • LABS:
      • Working with and
      • Creating Archives
      • Working With File Tasks

  • Session 17: ant Modularity
    • Properties Files
    • The Task and SubProjects
    • The Task For Importing Buildfiles
    • LABS:
      • Working With Properties Files
      • Creating Modular Buildfiles

  • Session 18: JUnit Basics
    • JUnit Overview, Test Driven Development
    • Tests and Assertions
    • Working With Exceptions
    • LABS:
      • Writing and Running Tests
      • Testing Exceptions

  • Session 19: Organizing Tests with JUnit
    • Writing Fixtures - @Before, @After
    • Test Suites, and Other Capabilities
    • Mock Objects
    • LABS:
      • Using Fixtures
      • Using Suites

  • Session 20: Introduction to Logging and log4j
    • Logging Overview
    • log4j Overview
    • Loggers, Appenders, Layouts
    • Configuring and Using log4j
    • Logger Hierarchy and Logging Levels
    • Working With Appenders
    • Using PatternLayout
    • Other Logging Frameworks (Java Logging, Apache Commons Logging)
    • LABS:
      • Setting Up log4j
      • Using Basic log4j Logging
      • Working With Loggers
      • Working With Appenders
      • Using Layouts


Go to course catalogue