Duration: 5 Days
This comprehensive, hands-on introduction to Java is geared for developers who have prior working knowledge of object-oriented (OO) programming languages such as C++.
Throughout the course, you will learn the best practices for writing great OO programs in Java 7 using sound development techniques, new improved features for better performance, and new capabilities for addressing rapid application development. You will participate in exercises, and you will work through a case study that covers the entire spectrum, from use cases to OO design to implemented classes. You can use the case study during and after the course as a reference and a tool for reviewing and practicing what you learned in class.
What You Will Learn
- Fundamentals of the Java language as well as its importance, uses, strengths, and weaknesses
- How Java relates to OO programming and the object model
- Use Java multi-threading and exception-handling features
- Use classes, inheritance, and polymorphism
- Use collections, generics, autoboxing, and enumerations, including new Java 7 features and capabilities
- Work with the logging API and framework that is part of the Java platform
- Use the Java Database Connectivity (JDBC) API for database access
- Use Java for networking and communication applications
- Work with annotations
- Work with the classes in the concurrent package
- Options for GUI applications in Java
- Take advantage of the Java tooling that is available with the programming environment being used in the class
Specific Java 7 features that are covered in the course include:
- Automatic closure of resources
- Handling multiple exceptions in a single catch block
- The diamond operator
- Support for multi-core platforms
- The Java NIO package
Audience
Experienced programmers and developers who have prior OO exposure and background (C++, etc)
Prerequistes
- OO development experience (such as working with C++)
- OO analysis and design experience similar to the content covered in Object-Oriented Analysis and Design with UML
Course Outline
1. Java: A First Look
- Using the JDK
- Setting Up Environment
- The Development Process
- Class Files
- Java Applications
- Writing a Simple Class
- Classes in Java
- Class Modifiers and Types
- Variables and Primitives
- Creating Objects
- The main Method
- Using the Dot Operator
- Writing Output
- The Java Platform
- Defining Java
- Java SE Development Kit (JDK)
- Executing Programs
- Lifecycle of a Java Program
- Java Virtual Machine (JVM)
- Java is Dynamic: The Runtime Process
- Garbage Collection
- Documentation and Code Reuse
- JavaDoc Provides Documentation Delivery
- In-Line Comments are Translated into HTML Rendering
2. OO Concepts In Java
- OO Programming
- The OO Way
- Real-World Objects
- Classes and Objects
- Object Behavior
- Methods and Messages
- Inheritance, Abstraction, and Polymorphism
- Encapsulation
- Inheritance
- Method Overriding
- Aggregation
- Type Abstraction: Grouping as Supertype
- Polymorphism
3. Getting Started with Java
- Adding Methods to the Class
- Instance Methods
- Passing Parameters into Methods
- Overloaded Methods
- Constructors
- Language Statements
- Operators
- Comparison and Logical Operators
- Using Comparison and Logical Operators
- Looping: The for Statement
- Looping: The while Statement
- Looping: The do Statement
- Continue and Break Statements
- The switch Statement
- Using Strings
- Strings
- StringBuffer
- StringTokenizer
- Scanner
- Formatter
- Specializing in a Subclass
- Extending a Class
- The extends Keyword
- Casting
- Overriding Superclass Methods
- Method Overriding Diagram
- Calling Superclass Methods from Subclass
- The Object Class
- The equals Method
- Constructors
4. Essential Java Programming
- Fields and Variables
- Fields vs. Variables
- Instance vs. Local Variables: Usage Differences
- Data Types
- Default Values
- Block Scoping Rules
- Using this
- Final and Static Fields
- Static Variable Diagram
- Using Arrays
- Arrays
- Accessing the Array
- Multidimensional Arrays
- Copying Arrays
- Static Methods and Fields
- Static Fields
- Simple Example of Static Fields
- Static Methods
- Java Packages and Visibility
- The Problem
- Packages
- Class Location of Packages
- The Package Keyword
- Importing Classes
- Executing Programs
- Accessibility/Visibility
- Java Naming Conventions
- Packages Diagram
5. Advanced Java Programming
- Inheritance and Polymorphism
- Polymorphism
- Polymorphism: The Subclasses
- Derived Classes as the Superclass
- Casting to the Derived Class
- Using instanceof for Downcasting
- Upcasting vs. Downcasting
- Calling Superclass Methods from Subclass
- The final Keyword
- Interfaces and Abstract Classes
- Separating Capability from Implementation
- Abstract Classes
- Shape as an Abstract Class
- Polymorphism with Abstract Classes
- Interfaces
- Implementing an Interface
- Extending Interfaces
- Polymorphism with Interfaces
- Type Checking
- Abstract Classes vs. Interfaces
- Interfaces Diagram
- Exceptions
- Exception Architecture
- Handling Exceptions
- The Throwable Class
- The try Block, The catch Block, and The finally Block
- Generalized vs. Specialized Exceptions
- Overriding Methods
- Creating Your Own Exceptions
- Throwing Exceptions
- Checked vs. Unchecked Exceptions
6. Java Developer's Toolbox
- Utility Classes
- Wrapper Classes
- The Number Class
- Numbers and Strings
- Big Decimal
- Random Numbers
- Decimal Formatting
- The Date Class
- Collections
- The Collections Framework
- Characterizing Collections
- Collection Interface Hierarchy
- Top-Level Collection Interfaces
- Collection Interface Provides Element Handling
- Collections Utility Methods
- Generics and Collections
- Generics and Parametric Polymorphism
- Java 7: The Diamond Operator
- Simple Generics
- Iterators
- The Set Interface; SortedSet
- Comparable; Comparator
- HashSet (Set) and TreeSet (SortedSet) Example
- NavigableSet
- The List Interface
- Queue Interface
- Map Interface Hierarchy
- Creating and Using a HashMap
- Feature Comparison
- Using the Right Collection
- Collection vs. Vector/Hashtable
- Collections and Multithreading
- Optimizing Collection Constructors: Initial Size
- Generics
- Generics and Subtyping
- Compiler Restrictions on Generics and Subtyping
- Wildcards
- Standard Rules Apply
- Generic Methods
- Interoperability with Legacy Code
- Raw Types
- Legacy Calls to Generics; When Generics Should Be Used
- Java GUIs
- Java Foundation Classes (JFC)
- Categories of Classes in JFC
- Creating the Frame and Adding Content to a Frame
- A Closer Look at Layout Managers
- BorderLayout
- JFC Provides an Event Handling Structure
- Autoboxing, Enhanced for Loop, and Varargs
- Autoboxing/Unboxing
- Iterators and Collections
- The for-each() Loop; For-each Loop Restrictions
- Legacy Variable Argument Support
- Variable Arguments and Varargs Rules
- Issues
- Enumerations and Static Imports
- Rationale for Enumerations
- Enumeration Syntax and Methods
- Enumerations as a Better Class Type
- EnumSet and EnumMap
- When You Should Use Enumerations
- Using Static Imports
- When You Should Use Static Imports
- Inner Classes
- Defining Inner Classes
- Member Inner Classes
- Local Inner Classes
- Anonymous Inner Classes
- Anonymous Subclassing
- Multithreading
- Principles of Multithreading
- Creating a Threaded Class
- Example: Runnable Class
- Daemon Threads
- Thread Scheduling and Signaling a Thread
- Sleeping
- Thread Synchronization
- Synchron
Course Labs
You will spend about half of class time performing hands-on labs, with extensive programming exercises designed to reinforce fundamental OO development skills, best practices, and concepts learned in the lessons.