EC23 - Java Fundamentals - SE Primer / Programming Workshop - 5 Days

Course Description

This course covers all major aspects of programming with Java. It is essentially a condensed version of courses EC21 (Java Primer) and EC22 (Java Programming) but excludes topics on Threads and Networking.


Pre-requisites

Knowledge of any programming language is advantageous but not essential.


Objectives

The aim of this course is to give students a fully rounded general knowledge of programming with Java providing not just basic skills but moving onto more advanced topics including Collections, Threads, I/O and Networking.

During the course the student will write many applications, classes and applets ensuring that the statements taught are fully understood and practical experience is gained.

On completion of this course the student will be able to:

  • use the major concepts of a modern, block-structured, high-level language, such as control flow, method calls and modular programming
  • structure programs using classes and other essential object-oriented features
  • take advantage of and understand Interfaces
  • use the Collections Framework
  • create and handle Exceptions
  • use the Java Input/Output classes
  • understand and use Serialization to achieve persistence


Environment

Development will be performed using:

  • Eclipse
  • IntelliJ
  • NetBeans
  • JBuilder


Customisation

For on-site courses (i.e. at your premises), we are more than happy to tailor the course agenda to suit your exact requirements. In many cases, we are able to build your in-house standards and naming conventions into the delivered course.


Course Details

INTRODUCTION TO JAVA
What Is Java?
The Java Programming Language
The Java Platform
What Can Java Do?
Advantages of using Java
The "Hello World" Application

OBJECT-ORIENTED CONCEPTS
What Is an Object?
The Benefits of Encapsulation
What Are Classes?
Objects vs. Classes
The Benefit of Classes
Sending Messages to an Object - Methods
The Benefits of Messages
What Is Inheritance?
The Benefits of Inheritance

VARIABLE DEFINITION AND MANIPULATION
Variables
Variable Naming
Naming Standards
Data Types
Literal Values
Numeric Literals
Variable Scope
Variable Initialisation
Final Variables (Constants)
Final Reference Variables
Escape Characters
Passing Arguments to JAVA Programs
Simple System Input / Output Techniques

ARITHMETIC AND BITWISE MANIPULATION
Arithmetic Operators
Unary Operations
Bitwise Operators
Assignment Operators
Expressions
Numeric Promotion
Literal Values - Casting
Casting
Implicit Casting

OBJECTS, METHODS AND CLASSES
Introduction to Classes and Objects
Methods
A Simple Example
Creating Objects
Objects With References To Objects
Manipulating Objects - Variables vs methods
Method Syntax
Calling an Objectxxs Methods
Passing Arguments
Passing Arguments - Under the Hood
Passing Arguments and Method Overloading
Variable Argument (VarArgs) Methods
Using the xxthis.xx and xxsuper.xx Prefix
Returning Values from Methods
Encapsulation
Constructors
Constructor Example
Constructor Syntax
Constructor Rules
Constructor Chaining
Static Variables
Static Code Blocks
Initialization Order
Using Final Fields
Cleaning Up Unused Objects - The Garbage Collector
Finalization

STRINGS
Strings
String Concatenation
String Methods
Testing for String Equality
String Manipulation - the StringBuilder class
Comparing StringBuilder Objects
StringTokenizer

CONTROL FLOW STATEMENTS
Relational Operators
Conditional Operators
Control Flow Statements
The if-else Statement
The Ternary Expression
The Switch Statement
For Loop Statements
For-Each loop Statements
While loop Statements
Do-while loop Statements
Breaking out of Loops: break and continue
Labelled Loops

ENUMS
Switching on Enums

INHERITANCE
Inheritance - Extending a Class
What does a Subclass Inherit?
Rules for Overriding Methods
Overriding Methods - Example
Covariance
Hiding Static Methods
Overriding Instance / Hiding Static - Methods Summary
Hiding Variables
Inherited Methods in java.lang.Object
Overriding Equals and HashCode

ARRAYS
Arrays
Allocating Storage for an Array
Using the ForEach Loop with Arrays
Passing Arrays as Arguments
Multi-Dimentional Arrays
Varying the Inner Dimension of a Two Dimensional Array
Arrays of Objects
Array Utilities
Sorting and Searching Arrays
Copying Arrays

VARARGS
Sending arguments
How do we use the data?
Using VarArgs in the Main method

PACKAGES
Packages
Packages of the Java Platform
Using Package Members
Importing a Package Member
Referring to a Package Member by Name
Class Name Conflict
Static Imports
Static Imports and Enums
Importing multiple members with the same name

JAVA KEYWORDS
Class Declarations
Variable Declarations
Method Declarations

CONVERSION, FORMATTING AND PRECISION
Data Type Conversion
Wrapper Classes
Autoboxing and Unboxing
Decimal Precision
Numeric Formatting
Other Formatting Techniques

DATES AND TIMES
Date Processing - Java 8 - The Need for Change
Creating Dates and Times
User Defined Dates
Java 8 - Manipulating Dates and Times
Java 8 - Manipulating Dates and Times with ChronoUnit
Java 8 - Working with Periods and Durations
Java 8 - Date Manipulation
Java 8 - Date and Time Formatting
Java 8 - Date and Time Parsing
Java 8 - Working with TimeZones
Java 8 - Date Compatibility with Java 7

CASTING OBJECTS
Casting Objects
Method Access Modifiers And Inheritance
Class Cast Exceptions

ABSTRACT CLASSES AND INTERFACES
Abstract Classes and Methods
Abstract Class Example
Interfaces
An Example Without Using Interfaces
Same Example Using Casting
Defining an Interface
Implementing an Interface
Same Example Using Interfaces
Implementing Methods
Interfaces with Static Variables and Methods
Interfaces with Default Methods - Java 8
Interface Methods vs Instance Methods - Rules
Duplicate Interface Methods - Rules
Functional Interfaces - Java 8

JAVA COLLECTIONS
Collection Interfaces
Summary Of Collection Implementations (Classes)
Generics
Class Used in the Examples
Lists - The ArrayList Class
Lists - List Methods
ArrayList Methods
LinkedList Methods
Traversing Collections
Iterator / For Each Loop Processing
Using Collection Classes - Maps
List Implementations
Map Implementations
SET IMPLEMENTATIONS
Queue and Deque
Stacks
Properties
Preferences
Collection Utilities
Sets - Set Methods
SortedSet Methods
Vector Methods
Maps - Map Methods
SortedMap Methods
Hashtable Methods
Streams - Java 8
Parallel Streams - Java 8
Map Enhancements - Java 8

SORTING OBJECTS
Sorting Objects
The Comparable Interface
Comparators
More Ways To Sort Objects
Sorting and Searching Collections

NESTED CLASSES & LAMBDA EXPRESSIONS
Member Inner Classes
Referencing the Outer Members from the Inner class
Example of Inner Class In Use
Method-Local Inner Classes
Anonymous Inner classes
Implementing Interfaces with Anonymous Inner Classes
Anonymous Inner Classes within Method calls
Static Nested Classes
Nested Class Summary
Functional Interfaces - Java 8
Using Lambda Expressions with Functional Interfaces
Lambda Expressions - Examples
Sorting Using the Comparator Interface - pre Java 8
Sorting Using the Comparator Interface - Lambda
Functional Interfaces and Generics
Using Method References - Java 8
Built-In Functional Interfaces
Built-In Functional Interfaces - Predicates
Built-In Functional Interfaces - Functions
Other Built-In Functional Interfaces

ERROR HANDLING
Java Exceptions
Error, Exception and RuntimeException Classes
Try / Catch Processing
The Finally Block
Java 7 Catch Blocks
Passing Exceptions Up the Stack – the Throws clause
The Throw Statement
User Defined Exceptions
Exceptions And Object Hierarchies
Using Exceptions as Arguments
Common Exception Types
Using System.exit() to Terminate
The Assert Statement

JAVA I/O
Class java.io.File
Input and Output Streams
Classes to Read / Write
NIO and Buffers
Reading from Files
close()
Reading from Files Using a Scanner
Reading from Files Using NIO
Writing to Files
Reading Data
Writing Data
Reading from System Input
Standard Output Stream - System.out
Serialization - Persistence of Objects

NIO2
Try-With-Resources
NIO2
Path
Files
FilesSystems and FileStore
File Change Notification

JUNIT INTRODUCTION
JUnit Example
JUnit assert Methods
Testing for exceptions
Testing Collections

JUNIT 4
Testing with JUnit4
Other JUnit 4 Features

JAVADOC
What Does Javadoc Generate?
Javadoc Tags
Where Can Tags Be Used?

ECLIPSE / NETBEANS
Startup
Perspectives
Views
Toolbars
Editors
Editors
Tasks, Markers and Bookmarks
Outline View
Importing and exporting
Searching
Rearranging Views
Comparing Files
Local History
Wizards

ECLIPSE / NETBEANS JAVA EDITOR
Editing code and elements
The editor context menu
Code Formatter
Managing Java Imports
Extract Method
Content/Code Assist
Templates
Quick Fix

RUNNING AND DEBUGGING
Running Java Apps
Debug perspective
Debugging


Course Format

Practical sessions make up a large part of the course, allowing delegates to demonstrate and reinforce the lectures given. During these sessions the delegate will build a simple but complete application.

Examples are used extensively, ranging from simple code 'snippets' to full applications with complete 'real world' functionality. These are supplied at the start of the course and it is encouraged that the delegates execute and 'experiment' with these under the instructor's guidance as they are introduced.

These examples are available to take away, along with the delegate's own work.

The comprehensive Student Guide supplied is fully indexed serving as a useful reference tool long after the course has finished. Delegates will also be able to access a free help-line with technical questions relating to topics covered on the course.


Course Enquiry