Introduction to Java Programming Training Course

Public Classroom

Summary

Java Logo

The Java 2 platform provides an architecture-neutral means to write object-oriented applications that scale well over time, have a shorter development cycle, and have improved maintainability. Java comes with a rich code library.

This Java programming hands-on course provides a solid introduction to object-oriented programming concepts, the Java language, the Java run-time and development environments and the code library – the Application Programming Interface (API). You will learn basic Java syntax, constructs and conventions, become familiar with the API documentation, understand Java’s implementation of the OO paradigm, and apply your newly acquired knowledge by writing a number of simple programs. After taking this course, you should have the ability to read, understand and analyze most Java code, and the skill to begin developing simple Java code.

Duration

4 days

Course Objectives

By the completion of the Introduction to Java Programming course you should be able to:

  • Understand the fundamental concepts of the Object-Oriented paradigm and their implementation in the Java Programming language
  • Be familiar with the Java language and its run-time and development environments
  • Know how to use the Application Programming Interface – the Java API
  • Write and maintain Java applications
  • Create, run, and debug Java programs
  • Control program flow with conditions and loops
  • Effectively use declarations, assignments, operators, flow-control structures, and program scope
  • Organize Java code into classes, packages and archives (JARs)
  • Understand Java error handling vial try/catch blocks and exceptions
  • Parse and process files using java.io and regular expressions
  • Utilize design patterns and best practices developing Java applications

Audience

This course is ideal for Programmers/Engineers, Support Engineers, and Web Application Developers

Pre-requisites

  • Experience programming in other languages such as COBOL,C, or in scripting languages, such as UNIX shell, Perl, or VBScript
  • Solid understanding of the basic programming concepts and constructs (variables, data types, loops and branching, and procedures/subroutines)

Outline

Java’s Characteristics

  • Java Virtual Machine
  • Interpreted
  • Architecture-Neutral and Portable
  • Multithreaded
  • Dynamic
  • Object-Oriented
  • Robust & Secure
  • High Performance

Java Technology: Overview

  • Java SE, EE, and ME
  • Java Virtual Machine (JVM)
  • Software Based Technology
  • Java Run-Time Environment (JRE)
  • Garbage Collector

Object-Oriented Paradigm

  • Abstraction
  • Encapsulation of Attributes and Behaviors
  • A Software Object – (Using UML)
  • An Application – Object Collaboration
  • Exercise: Create Two UML Object Diagrams

Messaging

  • Method Definition
  • Parameters/Arguments
  • A Blueprint of Method Statements
  • Method Declaration & Method Calls

Java Application Development

  • Java Development Tools
  • Create JAR files
  • Write, Compile and Run a Java Application

Java Language Basics

  • Java syntax and keywords
  • Identifiers and Naming Conventions

An Object-Oriented Framework

  • What is a Framework?
  • Packages of Classes
  • Package and Import Statements
  • Application Programming Interface (API)
  • Java’s API Documentation
  • Developer’s Job
  • Exercise: API

Instantiation

  • Class – Object’s Blueprint
  • Classes and Objects – Terminology
  • Constructor
  • Method Overloading

Variables and Data Types

  • Variable Declaration and Assignment
  • Primitive and Reference/Object Data Types
  • Allocation of Memory
  • Variable Scope
  • Local Variables
  • Instance & Class Variables
  • Variable Initialization
  • Type Casting
  • Exercise: Add a Method to a Class and Call it from Another Class
  • Exercise: A Driver Class and a Class for Instantiation
  • Exercise: Multiple Instances of a Class

Eclipse: An Integrated Development Environment (IDE)

  • Overview
  • Workspace
  • New Java Project
  • Editors and Controls

Arrays

  • Array Overview
  • Declaration, Assignment & Instantiation
  • Cell Value Assignment
  • Cell Value Retrieval
  • Exercise: Single Array

Operators and Expressions

  • Functionality
  • Precedence & Associativity
  • Logical Operators – Conditional AND (&&)
  • Logical Operators – Conditional OR (||)
  • Casting & Promotion

String and StringBuffer

  • Overview, differences and appropriate usage

Control Flow Statements

  • Loops (For, For Each While, Do While)
  • Decision making and branching
  • Exercise: For-Loop, String & StringBuilder
  • Exercise: For-Loop, String, StringBuilder & Fibonacci Logic
  • Exercise: For-loop, String, StringBuilder & Static Method
  • Branching (If, Else If, Else, Switch)
  • Exercise: Switch
  • Exercise: If, Else If & Logical Operators

Inheritance

  • Inheritance hierarchy
  • SubClass and SuperClass
  • Overriding Methods & Dynamic Method Binding
  • Polymorphism
  • Exercise: API
  • Exercise: Complete the Inheritance UML Diagram
  • Constructor – super()
  • Code: Rectangle & BetterRectangle
  • Code: BetterRectangleDriver
  • Exercise: Inheritance
  • Exercise: Inheritance & Instantiation
  • Getting Class and Superclass Information
  • Code: SuperClassGetter

Keyword: this

  • This Object
  • This Constructor – for Overloaded Constructors
  • Code: Keyword this – Multiple Constructors
  • Code: Keyword this – Multiple Constructors Driver

Access-Specifiers & Qualifiers

  • What is the difference?
  • Class, Variable, and Method Access-Specifiers
  • Variable and Method Qualifiers
  • Object’s Public Interface and Private Implementation
  • Accessors and Mutators
  • Exercise: Collaboration & the Public Keyword
  • Exercise: Collaboration & the Private & Package Keywords
  • Exercise: Code Cleanup & Access Check

Interface

  • Java’s Answer to Multiple Inheritance
  • A Class Implementing an Interface
  • Code: Identifiable.java – Interface
  • Code: MyInterfaceDemo – Driver Class
  • Code: HelloWorldApplet – Implements the Interface
  • Code: Rectangle – Implements the Interface
  • Code: StringManipulator – Implements the Interface
  • Summary of Interface Code Example
  • Exercise: Create an Interface and Implement it on 3 Classes

Inner classes

  • Overview
  • Member Class
  • Local Class
  • Anonymous Classes
  • Anonymous Class Rules
  • Nested top-level classes or interfaces
  • Inner Class Code Example

Exception Handling

  • Exception & Error Classes: To Catch or Not to Catch?
  • Exception & Error Subclasses
  • Exceptions are Thrown, Propagated-Up and Caught
  • try/catch/finally blocks
  • try/catch/finally Syntax
  • Java’s Catch or Specify Requirement
  • Code: PropagatorDriver
  • Code: Propagator
  • Exercise: Write Your Own Exception Class
  • Code: OwnException
  • Code: OwnExceptionDriver

Input/Output

  • Streams, Readers & Writers
  • Input & Output Superclasses
  • Classes of java.io Package
  • Code: KeyboardReader
  • Code: FileReader
  • Exercise: Rewrite MonthsArray
  • Exercise: Write FileReaderWriter
  • URLs
  • Exercise: Write URLReader
  • Exercise: Add Superclass

Collections

  • Overview
  • Collection and Related java.util Interfaces & classes
  • Iterator Interface
  • Code: ArrayListDemo
  • Code: HashSetDemo
  • HashMap and Related java.util Interfaces
  • Code: HashMapDemo
  • Generics
  • Iterating Through a Collection
  • Code: ArrayListDemo
  • Code: HashSetDemo
  • Code: HashMapDemo
  • Exercise: HashMap

Optional: Servlets and Multi-tear architecture

  • Clients and Servers
  • HTTP protocol
  • HTML in a nutshell
  • Processing an HTML form with a Servlet

Optional: GUI and Event-Handling

  • Brief overview of AWT
  • Understanding the Delegation Model