Modern Java Programming: A Crash Course
(Java Programming Using Java 8)

February 1-5 2016, JHU Dorsey Center, Elkridge MD
Co-Sponsored by Johns Hopkins Engineering for Professionals
JHU/EP Logo


This class is now over. Next public version is tentatively set for fall 2016 at the same Johns Hopkins location in Maryland. In the meantime, please contact hall@coreservlets.com for information on a customized onsite version at your location. Lower price, more convenient for your developers, and customizable content. Full-day courses can be held at any location worldwide, but for clients in the Baltimore/Washington area, late afternoon, evening, or weekend sessions can also be arranged.


“Wonderful. In 20 years, this is the best organized, most pragmatic and enjoyable course I've taken.”

“The best instructor-led course I have attended, by far.”

“Best short course ever!”

“Compared to the other short courses I have taken, this one completely redefined my scale from 1-10.”

“In my 35+ years of taking technical courses, Marty's classes consistently come out ranking #1 on my list. Highly relevant material is delivered with enthusiasm, humor, and a high degree of class interaction that is unmatched anywhere.”

more student reviews

Java Logo This page describes the public (open enrollment) training course on Java programming to be held February 1-5 2016 at in Elkridge, MD (co-sponsored by the Johns Hopkins University Engineering for Professionals program). The entire course is personally developed and taught by leading Java developer, speaker, and author Marty Hall. No contract instructor regurgitating someone else's materials! Marty has taught Java technology courses onsite for dozens of organizations in the US, Canada, Mexico, Australia, Japan, Norway, Puerto Rico, India, Cambodia, and the Philippines, all to rave reviews.

If you are looking for customized training courses on Java 7 or 8, JSF 2, PrimeFaces, Android, Ajax, jQuery, Hadoop (and Hadoop cerfication), GWT, Spring, Hibernate, Servlets, JSP, HTML5, or RESTful Web Services taught on-site at your company, please see this page.

Register Early! Five of Marty's previous public short courses were full, so reserve your spot today. Registrations are taken in the order they are received.


Course Overview

Java is the world's most popular and widely-applied programming language, but it is large, complex, and sometimes difficult to get started with. This course gives a practical, hands-on introduction to programming with Java 8, the latest version of the language.

The course starts with basic syntax, object-oriented programming basics (classes, methods, constructors), object-oriented programming intermediate capabilities (overloading, encapsulation, JavaDoc usage, inheritance, packages, toString), and object-oriented programming advanced features (abstract classes, interfaces, default methods, @Override, visibility modifiers, enums, inner classes). Java 8 syntax is used throughout.

The second section covers basic graphics, Lists, Maps, printf, varargs, how to create your own classes and methods that support generic types, and unit testing with JUnit.

The third section looks at concurrent programming using the Java threading framework and parallel programming using the Java fork/join framework.

The fourth section looks at lambda expressions and Java 8 streams, with particular emphasis on how using these features can make your code more reusable and more able to handle large data sets efficiently.

The final section looks at file I/O and networking (clients, servers, and serialization) and shows how harnessing the power of streams and multi-threaded programming can dramatically improve these types of applications.

In each section, the course gives details on the most important topics, surveys more advanced or lesser-used topics, stresses best practices, and gives plenty of working examples. Each section is followed by a series of hands-on exercises that use Java and Eclipse to reinforce the concepts. There are a choice of exercises of varying complexity so as to accommodate developers with various levels of expertise and previous experience.

Please note: this is a general Java programming course taught in the context of Java 8. It is aimed at those with previous experience in other languages, but little or no recent Java experience. If you are comfortable with earlier Java versions, don't take this course: take the mini Java 8 course instead.

The course is developed and taught by Marty Hall, an experienced developer, award-winning instructor, popular conference speaker (5 times at JavaOne), and author of several bestselling Java books. Marty normally runs on-site training courses at customer locations. This is easier administratively, is better for clients since the topics and schedule can be customized, and is more cost effective for students since no travel is required. However, due to demand from those who do not have enough students for an on-site course, Marty will be running a public (open enrollment) Java training course at the Johns Hopkins Dorsey Center in Elkridge MD.

About the Instructor

Marty Hall Marty Hall is president of coreservlets.com, a training and consulting company focusing on server-side Java technology, Android development, and front-end development with JavaScript and jQuery. In addition to long Java development and consulting experience, Marty has an extensive background in teaching and training, having given training courses on Java (now using Java 8), JSF 2, PrimeFaces, Android, Ajax/jQuery, GWT, and other Java EE topics in Japan, Canada, Australia, the Philippines, Mexico, Puerto Rico, India, Cambodia, Norway, and dozens of US venues. He has taught onsite at Google (both the Mountain View and NY offices), the NSA, the CIA, General Dynamics, Northrup Grumman, General Motors, VeriSign, Symantec, the Federal Reserve Bank, Comcast, Hewlett Packard, Fannie Mae, Motorola, Learjet, the US Navy, the Australian Treasury Department, Telenor Norway, and dozens of other organizations around the world. (A more extensive list can be found on Marty's bio page.)

JavaU @ JavaOne

A popular and entertaining speaker, Marty has also spoken at conferences and user groups around the world, including Comdex, the Web 2.0 Expo, and six times at JavaOne, most recently in 2015. Marty is also adjunct faculty in the Johns Hopkins University part-time graduate program in Computer Science, where he directs the Java and Web-related concentration areas.

Marty Hall is also the lead author of six popular Java EE books from Pearson, including Core Servlets and JSP, and is the co-author of the upcoming JSF 2.3 edition of Core JSF. He has also produced training videos for Pearson on JSF, PrimeFaces, Java 8 lambdas and streams (for those that know Java 7), general Java programming using Java 8 (for those new to Java), JavaScript, and jQuery.

  • Core Servlets and JSP is the all-time worldwide bestselling servlet/JSP book, published in Bulgarian, Chinese Simplified Script (Mainland China), Chinese Traditional Script (Taiwan), Czech, Greek, English, French, German, Hebrew, Japanese, Korean, Polish, Portuguese, Russian, and Spanish.
  • Core JSF is widely recognized as the leading text on Web App development with JavaServer Faces.
  • In addition be being best sellers in industry, Marty's books have been widely used in academia (including Stanford, MIT, Princeton, U.C. Berkeley, UCLA, Johns Hopkins, and dozens of others).

For more details, please see the Marty Hall bio.

Prerequisites

The course consists of an approximately equal mixture of lecture and hands-on lab time. The course assumes that all students are experienced programmers in some language: this is not a course for first-time programmers. Experience with C, C++, C#, or Objective-C is particularly helpful.

Please note: if you are already comfortable with Java, and just want to learn the new Java 8 features (lambdas, method references, streams, the java.util.function package, default methods in interfaces, etc.), don't take this course: take the mini Java 8 course instead.

Venue

JHU/EP Logo The course will be held at the Johns Hopkins Dorsey Center in Elkridge, Maryland. This is a modern, comfortable venue with separate computers for each student, fast internet connections, and with coffee, snacks, and meals included. Class meets from 8:30 am to 4:30 pm daily. For students who prefer to bring their own laptops, fast wifi is available, and you can email the instructor for information on installing the class software in advance.

For Maryland residents, the location is centrally located 5 minutes from BWI airport and has plenty of free parking. For out-of-town students, there are many hotels within 1 mile.

Registration

The five-day course costs $2695 per student and includes an extensive course notebook, a commercial textbook, exercises, and exercise solutions. Free breakfast, snacks, and lunch. Compare this price to courses from Learning Tree, GlobalKnowledge, and Oracle University that cost $3500-$4200 for five-day courses and $2800-$3000 for four-day courses and that do not include textbooks or meals. Besides, those courses almost always use an unknown instructor who did not develop the course materials and often lacks significant real-world development experience.

To register, fill out and send in the course registration form. Space is limited: five previous offerings of coreservlets.com courses were full. Bonus: Register at least two weeks in advance and get a $100 gift certificate from amazon.com.

Questions and More Info



  • Guinea pigs? No! Marty's courses are well-tested, having been taught in 8 countries and dozens of US venues. We don't use your developers as guinea pigs for new materials.
  • Regurgitation? No! Marty developed all his own materials. No contract instructor regurgitating memorized PowerPoint slides.
  • Green? No! Marty is an experienced developer, and is the author of 6 popular Java EE texts from Prentice Hall. The course gives best practices and real-world strategies. No newbie instructor dodging tough questions.

Syllabus

Course now uses Java 8 througout, with all sections using Java 8 syntax and extensive sections specifically on the powerful new Java 8 features. However, if you are already comfortable with Java, and just want to learn the new Java 8 features (lambdas, method references, streams, the java.util.function package, the Optional class, concrete methods in interfaces, etc.), don't take this course: take the mini Java 8 course instead.

Java with Eclipse: Setup and Getting Started

  • Installing Java
  • Installing Eclipse
  • Importing sample projects
  • Executing simple desktop programs
  • Executing applets
  • Eclipse shortcuts

Basic Java Syntax

  • Basics
  • Accessing arrays
  • Looping
  • Indenting code
  • if statements and other conditionals
  • Strings
  • Building arrays
  • Performing basic mathematical operations
  • Reading command-line input
  • Converting strings to numbers

Basic Object-Oriented Programming in Java

  • Similarities and differences between Java and C++
  • Object-oriented nomenclature and conventions
  • Instance variables (data members, fields)
  • Methods (member functions)
  • Constructors
  • Example: Person class with four variations

Object-Oriented Programming in Java: More Capabilities

  • Overloading
  • Best practices for "real" classes
    • Encapsulation and accessor methods
    • JavaDoc
  • Inheritance
  • Packages
  • The toString method
  • More iterations of the Person class

Object-Oriented Programming in Java: Advanced Capabilities

  • Abstract classes
  • Interfaces
  • @Override
  • Visibility modifiers
  • Enums
  • JavaDoc options
  • The classpath

Applets and Basic Graphics

  • Applet restrictions
  • Basic applet and HTML template
  • The value of @Override
  • The applet lifecycle
  • Customizing applets through HTML parameters
  • Methods available for graphical operations
  • Loading and drawing images
  • Using try/catch blocks (part 1)
  • Controlling image loading

More Java Syntax and Utilities

  • Data structures
    • ArrayList
    • LinkedList
    • HashMap
  • Generic types
    • Using classes and methods that already support generics
    • Defining your own classes and methods that support generics
  • The Arrays utility class
  • printf
  • varargs
  • String vs. StringBuilder

Unit Testing with JUnit

  • Static imports
  • JUnit overview
  • Modern style
    • assertThat(value, matcher(...))
    • is, equalTo, nullValue, hasItem, not, anyOf, allOf, etc.
  • Traditional style
    • assertEquals, assertTrue, assertFalse

Asynchronous Event Handling

  • General event-handling strategy
  • Event-handling options (same four options will be used later with GUI controls and threads)
    • Handling events with separate listeners
    • Handling events by implementing interfaces
    • Handling events with named inner classes
    • Handling events with anonymous inner classes
    • Preview: handling events with Java 8 lambdas
  • The standard AWT listener types
  • Subtleties with mouse events

Concurrent Programming with Java Threads

  • Motivation
    • And comparing concurrent and parallel programming
  • Basic approach
    • Make a task list with Executors.newFixedThreadPool
    • Add tasks to the list with tasks.execute(someRunnable)
  • Variations on the theme
    • Separate classes that implement Runnable
    • Main app implements Runnable
    • Inner classes that implement Runnable
    • Lambda expressions
  • Related topics
    • Race conditions and synchronization
    • Helpful Thread-related methods
    • Brief summary of advanced issues in concurrency

Parallel Programming with the Fork/Join Framework

  • Basics
    • Concurrent vs. parallel programming
    • General fork/join strategy
    • Making code to time operations
    • Summing an array: simple approach
    • Preview: array sum with Java 8 streams
  • Advanced
    • Defining a reusable parallel array processor
    • Summing an array
    • Finding minimum of complex calculations
    • Generating large prime numbers

Lambda Expressions: Part 1

  • Intro
    • Motivation
    • Quick summary of big idea
  • New Java 8 option: lambdas
    • Interpretation
    • Most basic form
    • Type inferencing
    • Expression for body
    • Omitting parens
    • Comparing lambda approaches to alternatives
  • Examples
    • Numerical integration
    • Timing utilities

Lambda Expressions: Part 2

  • The @FunctionalInterface annotation
  • Method references
  • Lambda scoping rules
  • Effectively final local variables

Lambda Expressions: Part 3 -- Lambda Building Blocks

  • Simply-typed versions
  • Predicate
  • Function
  • BinaryOperator
  • Consumer
  • Supplier

Lambda Expressions: Part 4

  • Static and default methods in interfaces
    • Syntax
    • Benefits
    • Resolving conflicts
  • Methods that return lambdas
    • Big idea
    • From Predicate: and, or, negate, isEqual
    • From Function: andThen, compose, identity
    • From Consumer: andThen
    • Custom methods

Java 8 Streams: Part 1

  • Overview of streams
  • Building streams from arrays, Lists, and individual entries
  • Outputting streams into arrays or Lists
  • Core stream methods
    • Overview
    • forEach
    • map
    • filter
    • findFirst and findAny
    • toArray and collect
  • The new Optional class
  • Lazy evaluation and short-circuit operations

Java 8 Streams: Part 2

  • More stream methods
    • limit, skip
    • sorted, min, max , distinct
    • noneMatch, allMatch, anyMatch, count
  • Number-specialized streams
    • IntStream, DoubleStream, LongStream
  • Reduction operations
    • reduce(starterValue, binaryOperator)
    • reduce(binaryOperator).orElse(...)
    • min, max, sum, average

Java 8 Streams: Part 3

  • Grouping stream elements
    • Fancy uses of collect
  • Parallel streams
    • Why stream approach is often better than traditional loops
    • Best practices: verifying speedup and "same" answer
    • Knowing when parallel reduce is safe
  • Infinite streams
    • Really unbounded streams with values that are calculated on the fly

File I/O in Java 8: Applying the Power of Streams

  • More on try/catch blocks: finally, multicatch, try-with-resources
  • Representing file paths: Paths.get
  • Reading files : Files.lines
  • Writing files: Files.write
  • Exploring folders: Files.list, Files.walk, Files.find
  • Reading files in Java 7: Files.readAllLines
  • Lower-level file IO utilities: Files.newBufferedReader, Files.newBufferedWriter

Network Programming: Clients

  • Overview
  • Using PrintWriter and BufferedReader
  • Basic steps for connecting a client to a server
  • Implementing a generic network client
  • String formatting and parsing: printf, StringTokenizer, String.split and regular expressions
  • Problems with blocking I/O
  • Getting user info from a mail server
  • Talking to Web servers: general
  • Talking to Web servers: Java clients

Network Programming: Servers

  • Steps for creating a server
    1. Create a ServerSocket object
    2. Create a Socket object from ServerSocket
    3. Create an input stream
    4. Create an output stream
    5. Do I/O with input and output streams
    6. Close the socket
  • A generic network server
    • Single threaded
    • Multithreaded
  • Accepting connections from browsers
  • A Simple HTTP server

Network Programming: Using Serialization to Send High-Level Data Structures

  • Idea
  • Requirements
  • Steps for sending data
  • Steps for receiving data
  • Example: saving GUI in file
  • Example: sending GUI across network