J5 tutorHomepage
The aim of this site is to learn and improve knowledge of the Java programming language, version 5 and give an insight into the Java Standard Edition 5 Programmer Certified Professional Exam (IZO-583), which when passed gives the Oracle Certified Professional, Java SE 5 Programmer certification. The site is divided into three sections covering the Java5 programming language, the certification and a case study.
Learn Java5
This part of the site covers the Java language from the ground up, introducing different aspects of the language as we work through the sections detailed below:
Beginning Java5
We start out by downloading a JDK and setting up our environment before beginning our journey into Java5. With the environment set up we introduce the code structure of a Java source file and look at syntax. After this we look at the primitive variables available in Java before discussing method scope. We then take an in-depth look at the symbols used for mathematical and logical manipulation that are recognized by the compiler and commonly known as operators. Every computer language has conditional branching and loop structures and Java is no exception. We finish off this section with a look at the conditional and loop statements available in Java5.
Objects & Classes
The main emphasis of the Beginning Java5 section of the site was an introduction to the basic building blocks required to write a java program. This section is all about objects
and the classes used to construct them. We start by looking at a predefined data type, the Array object. Investigation of this class will give us an insight into using objects and classes before we
start to create our own. After this we examine class structure and the syntax required for class construction, before investigating reference variables and how to use them in Java. We have used methods throughout the lessons
so far, and the next lesson in the section goes into these members in much more detail. We then look at instance variables and their scope before studying constructors which are used to instantiate our objects. We finish the
section by taking an in-depth look at static members, followed by a new feature in Java5, enumerations.
OO Concepts
Up until now, for learning purposes, we have ignored many important object oriented concepts that we can use within our Java programs. This neglect is rectified in this section where we start our study of OO concepts by
looking at encapsulation and how to protect our data. We then tackle inheritance over two lessons where we look at creating hierarchies, overriding methods and the use of super. After this we look at
abstraction and how we apply it to our classes and methods. We then examine polymorphism and how to use it with our methods, arguments and return types. Our investigation of polymorphism continues as we investigate interfaces
and their usage. We then return to the idea of encapsulation as we look into nested classes, what they are and how to use them. We finish the section with a detailed look at the Object class and the methods
we inherit and can override in our subclasses.
Flow Control
In this section we finish our studies on flow control by studying exceptions and assertions. Firstly we look at Java exceptions where we make a thorough investigation of the exception hierarchy and how Java's exception architecture hangs together. With an overview of exceptions under our belt we look at handling the various forms of exception in our code. After this we look at declaring and throwing exceptions in our code, which we can deal with straight away or allow to propagate up the stack to be dealt with elsewhere. We finish of our investigation of exceptions by creating our own bespoke checked and unchecked exceptions for when needed. With exceptions covered we turn our attention to the assertion mechanism available in Java. We learn appropriate uses of assertions and when not to use them. We also look at the runtime commands used to enable assertions, as and when required.
API Contents
In our fifth section on learning Java5 we begin our investigations of the Java API by looking at the String, StringBuilder and StringBuffer classes. These predefined classes come
with a multitude of methods for working with strings and are part of the java.lang package which is implicitly imported into all out Java programs for us. After this we broaden our horizon of Java
by investigating classes that are not implicitly imported into our programs. Before we look at other parts of the Java API however, we need to take a closer look at how Java stores predefined classes into namespaces,
which Java calls packages, and how we can import these packages into our programs. With knowledge of packages under our belt we can now look at parts of the Java API outside the default java.lang
package. Our first port of call is how we use I/O in Java and for this we will look at the java.IO package. We start our exploration of Java I/O by looking at the class hierarchies involved
and then take an in-depth look at the byte stream classes and character stream classes used for this purpose. After this we look at the classes available for working with dates, numbers and
currencies. Most languages have an implementation of regular expressions and Java is no exception and we look at the classes used for pattern matching. We finish off our tour of the Java API
by looking at formatting and tokenizing our data.
Concurrency
In our sixth section on learning Java5 we look at multithreading and how to run parts of our program concurrently. We explain the terminology behind concurrency before looking in detail at running parts of
a program concurrently by subclassing the Thread class and also by declaring a class that implements the Runnable interface. Running separate threads
at the same time is great and we can certainly improve the performance of our programs using multithreading. But what happens when concurrent threads need to access and update some shared resource?
Java deals with this problem with synchronization and we investigate how we can control access to our code by synchronising at the method or block level. After this we investigate thread priorities and how
we can have the priority set automatically by the invoking thread or assign thread priorities ourselves using methods of the Thread class. We finish our look at concurrency by
looking at how threads can interact with each other when they are within a synchronized method or code block.
Collections/Generics Section Under Construction
??.
Swing Section Under Construction
??.
Remote Method Invocation Section Under Construction
??.
Java5 Certification
This section of the site covers the requirements for the Java Standard Edition 5 Programmer Certified Professional Exam (IZO-583) which when passed gives the Oracle Certified Professional, Java SE 5 Programmer certification..
Case Study
We try to put what we have learnt to use by doing a simple case study.