Advanced Java

Prerequisites

You should already be at the Introduction to Programming or Excel VBA level.
If in doubt, you must be able to pass this test in a programming language of your choice, before attempting this course.

Intended Audience

This course is intended for people who has completed our Beginner Java course or is at the same level. The Advanced Java training course is meant to apply everything you have learned in the Beginner Java course, learning new things and making use of more practical features of Java like swing / IO, networking, data structures and more. After completing this course and the one before, you would have covered most of the topics required to prepare for the international exam, OCA and OCP as well as build small SE applications. To get intensive job-graded preparation assistance, have a look at our Java Bootcamp.

After this course you should be able to

Have a good understanding of programming and the building blocks of an OO programming language, with an emphasis on JAVA.
Proceed to any of these courses

Course Material

If you had done our Java Beginner, we gave you an original copy of the book: Head First Java (by O’Reilly Press) as we use this mainly, but we also give additional examples where it falls short. If you had not done it with us, you will have to purchase the book separately.

Course Contents

Day 1:

  • Numbers and Statics: Numbers Matter
  • MATH methods: as close as you’ll ever get to a global method
  • The difference between regular (non-static) and static methods
  • What it means to have a class with static methods
  • Static methods can’t use non-static (instance) variables!
  • Static methods can’t use non-static methods, either!
  • Static variable: value is the same for ALL instances of the class
  • Initializing a static variable
  • static final variables are constants
  • final isn’t just for static variables…
  • Math methods
  • Wrapping a primitive
  • Before Java 5.0, YOU had to do the work…
  • Autoboxing: blurring the line between primitive and object
  • Autoboxing works almost everywhere
  • Wrappers have static utility methods too!
  • Turning a primitive number into a String
  • Number formatting
  • Formatting deconstructed…
  • The percent (%) says, “insert argument here”
  • The format String uses its own little language syntax
  • The format specifier
  • The only required specifier is for TYPE
  • What happens if I have more than one argument?
  • Working with Dates
  • Moving backward and forward in time
  • Getting an object that extends Calendar
  • Working with Calendar objects
  • Highlights of the Calendar API
  • Even more Statics!… static imports


Day 3:

  • Swing components
  • Layout Managers
  • The Big Three layout managers: border, flow, and box
  • Playing with Swing components
  • Making the BeatBox
  • Serialization and File I/O: Saving Objects
  • Capture the Beat
  • Saving State
  • Writing a serialized object to a file
  • Data moves in streams from one place to another
  • What really happens to an object when it’s serialized?
  • But what exactly IS an object’s state? What needs to be saved?
  • Implement Serializable
  • Deserialization: restoring an object
  • Saving and restoring the game characters
  • Writing a String to a Text File
  • Text File Example: e-Flashcards
  • Quiz Card Builder (code outline)
  • The java.io.File class
  • Reading from a Text File
  • Quiz Card Player (code outline)
  • Parsing with String split()
  • Version ID: A Big Serialization Gotcha
  • Using the serialVersionUID
  • Saving a BeatBox pattern
  • Restoring a BeatBox pattern

Day 5:

  • Collections and Generics: Data structures
  • Tracking song popularity on your jukebox
  • But the ArrayList class does NOT have a sort() method!
  • ArrayList is not the only collection
  • You could use a TreeSet… 
  • Or you could use the Collections.sort() method
  • Adding Collections.sort() to the Jukebox code
  • But now you need Song objects, not just simple Strings
  • Changing the Jukebox code to use Songs instead of Strings
  • Generics means more type-safety
  • Learning generics
  • Using generic CLASSES
  • Using type parameters with ArrayList
  • Using generic METHODS
  • Revisiting the sort( ) method
  • In generics, “extends” means “extends or implements”
  • The new, improved, comparable Song class
  • Using a custom Comparator
  • Updating the Jukebox to use a Comparator.
  • We need a Set instead of a List
  • The Collection API (part of it)
  • Using a HashSet instead of ArrayList
  • How a HashSet checks for duplicates: hashCode() and equals()
  • The Song class with overridden hashCode() and equals()
  • And if we want the set to stay sorted, we’ve got TreeSet
  • What you MUST know about TreeSet…
  • TreeSet elements MUST be comparable
  • We’ve seen Lists and Sets, now we’ll use a Map
  • Using polymorphic arguments and generics
  • But will it work with ArrayList ?
  • Wildcards to the rescue
  • Alternate syntax for doing the same thing
  • Package, Jars and Deployment: Release Your Code
  • Deploying your application
  • Separate source code and class files
  • Put your Java in a JAR
  • Running (executing) the JAR
  • Put your classes in packages!
  • Preventing package name conflicts
  • Compiling and running with packages
  • The -d flag is even cooler than we said
  • Making an executable JAR with packages
  • Java Web Start
  • The .jnlp file
  • Remote Deployment with RMI: Distributed Computing
  • Method calls are always between two objects on the same heap
  • Invoke a method on an object running on another machine
  • Object A, running on Little, wants to call a method on Object B, running on Big
  • The role of the ‘helpers’
  • Java RMI gives you the client and service helper objects!
  • How does the client get the stub object?
  • How does the client get the stub class?
  • Be sure each machine has the class files it needs
  • Yeah, but who really uses RMI?
  • Final Code Kitchen
  • Final BeatBox client program
  • Final BeatBox server program
Day 2:

  • Exception Handling: Risky Behavior
  • Let’s make a Music Machine
  • First we need a Sequencer
  • An exception is an object… of type Exception
  • If it’s your code that catches the exception?
  • Flow control in try/catch blocks
  • Exceptions are polymorphic
  • Multiple catch blocks must be ordered from smallest to biggest
  • When you don’t want to handle an exception…
  • Ducking (by declaring) only delays the inevitable
  • Making actual sound
  • Your very first sound player app
  • Making a MidiEvent (song data)
  • MIDI message: the heart of a MidiEvent
  • Change a message
  • Getting GUI: A Very Graphic Story
  • Your first GUI: a button on a frame
  • Getting a user event
  • Listeners, Sources, and Events
  • Getting back to graphics…
  • Make your own drawing widget
  • Fun things to do in paintComponent()
  • Behind every good Graphics reference is a Graphics2D object
  • GUI layouts: putting more than one widget on a frame
  • Let’s try it with TWO buttons
  • So now we need FOUR widgets
  • And we need to get TWO events
  • An inner class instance must be tied to an outer class instance
  • How to make an instance of an inner class
  • Using an inner class for animation
  • Listening for a non-GUI event
  • An easier way to make messages / events


Day 4:

  • Networking and Threads: Make a Connection
  • Real-time Beat Box Chat
  • Connecting, Sending, and Receiving
  • Make a network Socket connection
  • A TCP port is just a number.
  • To read data from a Socket, use a BufferedReader
  • To write data to a Socket, use a PrintWriter
  • DailyAdviceClient code
  • Writing a simple server
  • DailyAdviceServer code
  • Writing a Chat Client
  • Java has multiple threads but only one Thread class
  • What does it mean to have more than one call stack?
  • Every Thread needs a job to do.
  • To make a job for your thread, implement the Runnable interface
  • The Thread Scheduler
  • Putting a thread to sleep
  • Using sleep to make our program more predictable
  • Making and starting two threads
  • The Ryan and Monica problem, in code
  • We need the makeWithdrawal ( ) method to run as one atomic thing
  • Using an object’s lock
  • The dreaded “Lost Update” problem
  • Make the increment() method atomic. Synchronize it!
  • The deadly side of synchronization
  • New and improved SimpleChatClient
  • The really really simple Chat Server

 

Duration and pricing

  • Full-time over 5 days (R7995 excl VAT)
  • Part-time over 4 weeks (2 nights per week, 3 hour sessions) (R9995 excl Vat)
  • Part-time over 8 Saturdays, 3 hour sessions (R9995 excl Vat)
  • Distance-learning over up to 3 months (R6995 excl Vat)

Certificate

1. Upon completion of this course we will issue you with attendance certificate to certify your attendance and / or completion of the prescribed minimum examples.
2. You have the option to get the competency / academic certificate if you :
hand in a project (pre-approved) covering most of the topics in the book.

Schedule

On the calender on this page below.
If your browser doesn’t display the calendar below, please click on this link or try using Google Chrome, alternatively please enquire via our ‘Contact Us’ page.

Bookings

You can download the course registration form on our home page or by clicking here

Brochure

You may download a pdf copy of this page by clicking here.

Questions

Please email us