Overview
This Java SE 8 Fundamentals training introduces you to object-oriented programming using the Java language. Through hands-on exercises, you’ll begin to build a baseline of knowledge to propel your career in development.
Learn To:
- Use Java programming language constructs to create a Java technology application.
- Use decision and looping constructs and methods to dictate program flow.
- Understand basic object oriented concepts such as inheritance, encapsulation, and abstraction.
- Use and manipulate object references, and to write simple error handling code.
- Use the new SE 8 java.time and java.time.format packages to format and print the local date and time.
- Specify a data modification by passing a predicate lambda expression to the Collections class.
Skills Covered
Upon completing this course, the learner will be able to meet these overall objectives:
- Write Java code that uses variables, arrays, conditional and loop constructs
- Manipulate primitive numeric data and string data using Java operators
- Create Java classes and use object references
- Access the fields and methods of an object
- Manipulate text data using the methods of the String and String Builder classes
- Use casting without losing precision or causing errors
- Declare, override, and invoke methods
- Access and create static fields and methods
- Use classes from the java.time and java.time.format packages to format and print the local date and time
- Encapsulate a class using access modifiers and overloaded constructors
- Define and implement a simple class hierarchy
- Demonstrate polymorphism by implementing a Java Interface
- Use a Predicate Lambda expression as the argument to a method
- Handle a checked exception in a Java application
Who Should Attend
- Application Developers
- System Administrator
- Project Manager
- Developer
- Technical Consultant
- Technical Administrator
- Team Leader
- Web Administrator
Course Curriculum
Course Modules
About This Course 1-2
Audience 1-3
Course Objectives 1-4
Schedule 1-6
Course Environment 1-9
Test Your Lab Machines 1-11
How Do You Learn More After the Course? 1-12
Quiz 1-13
Summary 1-14
Objectives 2-2
Topics 2-3
Purpose of a Computer Program 2-4
Translating High-Level Code to Machine Code 2-5
Linked to Platform-Specific Libraries 2-6
Platform-Dependent Programs 2-7
Topics 2-8
Key Features of the Java Language 2-9
Java Is Platform-Independent 2-10
Java Programs Run In a Java Virtual Machine 2-11
Procedural Programming Languages 2-12
Java Is an Object-Oriented Language 2-13
Topics 2-14
Verifying the Java Development Environment 2-15
Examining the Installed JDK (Linux Example): The Tools 2-16
Examining the Installed JDK (Windows Example): The Libraries 2-17
Topics 2-18
Compiling and Running a Java Program 2-19
Compiling a Program 2-20
Executing (Testing) a Program 2-21
Output for a Java Program 2-22
Exercise 2-1 2-23
Quiz 2-24
Summary 2-25
Objectives 3-2
Topics 3-3
Java Classes 3-4
Program Structure 3-5
Java Packages 3-6
Using the Java Code Console 3-7
Using the Java Code Console: Creating a New Java Class 3-8
Using the Java Code Console: Creating a New Java Class for an Exercise 3-9
Exercise 3-1: Creating a Class 3-10
Topics 3-11
The main Method 3-12
A main Class Example 3-13
Output to the Console 3-14
Fixing Syntax Errors 3-15
Exercise 3-2: Creating a main Method 3-16
Quiz 3-17
Summary 3-18
Objectives 4-2
Topics 4-3
Variables 4-4
Variable Types 4-5
Naming a Variable 4-6
Uses of Variables 4-7
Topics 4-8
Variable Declaration and Initialization 4-9
String Concatenation 4-10
String Concatenation Output 4-11
Exercise 4-1: Using String Variables 4-12
Quiz 4-13
Topics 4-14
int and double Values 4-15
Initializing and Assigning Numeric Values 4-16
Topics 4-17
Standard Mathematical Operators 4-18
Increment and Decrement Operators (++ and –) 4-19
Operator Precedence 4-20
Using Parentheses 4-22
Exercise 4-2: Using and Manipulating Numbers 4-23
Quiz 4-24
Summary 4-26
Objectives 5-2
Topics 5-3
Making Decisions 5-4
The if/else Statement 5-5
Boolean Expressions 5-6
Relational Operators 5-7
Examples 5-8
Exercise 5-1: Using if Statements 5-9
Quiz 5-10
Topics 5-11
What If There Are Multiple Items in the Shopping Cart? 5-12
Introduction to Arrays 5-13
Array Examples 5-14
Array Indices and Length 5-15
Declaring and Initializing an Array 5-16
Accessing Array Elements 5-18
Exercise 5-2: Using an Array 5-19
Quiz 5-20
Topics 5-22
Loops 5-23
Processing a String Array 5-24
Using break with Loops 5-25
Exercise 5-3: Using a Loop to Process an Array 5-26
Quiz 5-27
Summary 5-28
Play Time! 5-29
About Java Puzzle Ball 5-30
Tips 5-31
Interactive Quizzes 6-2
Objectives 6-3
Topics 6-4
Java Puzzle Ball 6-5
Java Puzzle Ball Debrief 6-6
Object-Oriented Programming 6-7
Duke’s Choice Order Process 6-8
Characteristics of Objects 6-9
Classes and Instances 6-10
Quiz 6-11
Topics 6-12
The Customer Properties and Behaviors 6-13
The Components of a Class 6-14
Modeling Properties and Behaviors 6-15
Exercise 6-1: Creating the Item Class 6-16
Topics 6-17
Customer Instances 6-18
Object Instances and Instantiation Syntax 6-19
The Dot (.) Operator 6-20
Objects with Another Object as a Property 6-21
Quiz 6-22
Topics 6-23
Accessing Objects by Using a Reference 6-24
Working with Object References 6-25
References to Different Objects 6-28
References and Objects in Memory 6-30
Assigning a Reference to Another Reference 6-31
Two References, One Object 6-32
Exercise 6-2: Modify the ShoppingCart to Use Item Fields 6-33
Topics 6-34
Arrays Are Objects 6-35
Declaring, Instantiating, and Initializing Arrays 6-36
Storing Arrays in Memory 6-37
Storing Arrays of Object References in Memory 6-38
Quiz 6-39
Topics 6-41
Java IDEs 6-42
The NetBeans IDE 6-43
Creating a Java Project 6-44
Creating a Java Class 6-45
Avoiding Syntax Problems 6-46
Compile Error: Variable Not Initialized 6-47
Runtime Error: NullPointerException 6-48
Compiling and Running a Program by Using NetBeans 6-49
Topics 6-50
Soccer Application 6-51
Creating the Soccer Application 6-52
Soccer Web Application 6-53
Summary 6-54
Challenge Questions: Java Puzzle Ball 6-55
Practice 6-1 Overview: Creating Classes for the Soccer League 6-56
Practice 6-2 Overview: Creating a Soccer Game 6-57
Objectives 7-2
Topics 7-3
String Class 7-4
Concatenating Strings 7-5
String Method Calls with Primitive Return Values 7-8
String Method Calls with Object Return Values 7-9
Topics 7-10
Java API Documentation 7-11
Java Platform SE 8 Documentation 7-12
Java Platform SE 8: Method Summary 7-13
Java Platform SE 8: Method Detail 7-14
indexOf Method Example 7-15
Topics 7-16
StringBuilder Class 7-17
StringBuilder Advantages over String for Concatenation (or Appending) 7-18
StringBuilder: Declare and Instantiate 7-19
StringBuilder Append 7-20
Quiz 7-21
Exercise 7-1: Use indexOf and substring Methods 7-22
Exercise 7-2: Instantiate the StringBuilder object 7-23
Topics 7-24
Primitive Data Types 7-25
Some New Integral Primitive Types 7-26
Floating Point Primitive Types 7-28
Textual Primitive Type 7-29
Java Language Trivia: Unicode 7-30
Constants 7-31
Quiz 7-32
Topics 7-33
Modulus Operator 7-34
Combining Operators to Make Assignments 7-35
More on Increment and Decrement Operators 7-36
viii
Increment and Decrement Operators (++ and ––) 7-37
Topics 7-38
Promotion 7-39
Caution with Promotion 7-40
Type Casting 7-42
Caution with Type Casting 7-43
Using Promotion and Casting 7-45
Compiler Assumptions for Integral and Floating Point Data Types 7-46
Automatic Promotion 7-47
Using a long 7-48
Using Floating Points 7-49
Floating Point Data Types and Assignment 7-50
Quiz 7-51
Exercise 7-3: Declare a Long, Float, and Char 7-52
Summary 7-53
Play Time! 7-54
Practice 7-1 Overview: Manipulating Text 7-55
Objectives 8-2
Topics 8-3
Basic Form of a Method 8-4
Calling a Method from a Different Class 8-5
Caller and Worker Methods 8-6
A Constructor Method 8-7
Writing and Calling a Constructor 8-8
Calling a Method in the Same Class 8-9
Topics 8-10
Method Arguments and Parameters 8-11
Method Parameter Examples 8-12
Method Return Types 8-13
Method Return Types Examples 8-14
Method Return Animation 8-15
Passing Arguments and Returning Values 8-16
More Examples 8-17
Code Without Methods 8-18
Better Code with Methods 8-19
Even Better Code with Methods 8-20
Variable Scope 8-21
Advantages of Using Methods 8-22
Exercise 8-1: Declare a setColor Method 8-23
Topics 8-24
Java Puzzle Ball 8-25
Java Puzzle Ball Debrief 8-26
Static Methods and Variables 8-27
Example: Setting the Size for a New Item 8-28
Creating and Accessing Static Members 8-29
When to Use Static Methods or Fields 8-30
Some Rules About Static Fields and Methods 8-31
Static Fields and Methods vs. Instance Fields and Methods 8-32
Static Methods and Variables in the Java API 8-33
Examining Static Variables in the JDK Libraries 8-34
Using Static Variables and Methods: System.out.println 8-35
More Static Fields and Methods in the Java API 8-36
Converting Data Values 8-37
Topics 8-38
Passing an Object Reference 8-39
What If There Is a New Object? 8-40
A Shopping Cart Code Example 8-41
Passing by Value 8-42
Reassigning the Reference 8-43
Passing by Value 8-44
Topics 8-45
Method Overloading 8-46
Using Method Overloading 8-47
Method Overloading and the Java API 8-49
Exercise 8-2: Overload a setItemFields Method 8-50
Quiz 8-51
Summary 8-52
Challenge Questions: Java Puzzle Ball 8-53
Practice 8-1 Overview: Using Methods 8-54
Practice 8-2 Overview: Creating Game Data Randomly 8-55
Practice 8-3 Overview: Creating Overloaded Methods 8-56
Interactive Quizzes 9-2
Objectives 9-3
Topics 9-4
What Is Access Control? 9-5
Access Modifiers 9-6
Access from Another Class 9-7
Another Example 9-8
Using Access Control on Methods 9-9
Topics 9-10
Encapsulation 9-11
Get and Set Methods 9-12
Why Use Setter and Getter Methods? 9-13
Setter Method with Checking 9-14
Using Setter and Getter Methods 9-15
Exercise 9-1: Encapsulate a Class 9-16
Topics 9-17
Initializing a Shirt Object 9-18
Constructors 9-19
Shirt Constructor with Arguments 9-20
Default Constructor and Constructor with Args 9-21
Overloading Constructors 9-22
Quiz 9-23
Exercise 9-2: Create an Overloaded Constructor 9-24
Summary 9-25
Play Time! 9-26
Practice 9-1 Overview: Encapsulating Fields 9-27
Practice 9-2 Overview: Creating Overloaded Constructors 9-28
Objectives 10-2
Topics 10-3
Review: Relational Operators 10-4
Testing Equality Between String variables 10-5
Common Conditional Operators 10-9
Ternary Conditional Operator 10-10
Using the Ternary Operator 10-11
Exercise 10-1: Using the Ternary Operator 10-12
Topics 10-13
Java Puzzle Ball 10-14
Java Puzzle Ball Debrief 10-15
Handling Complex Conditions with a Chained if Construct 10-16
Determining the Number of Days in a Month 10-17
Chaining if/else Constructs 10-18
Exercise 10-2: Chaining if Statements 10-19
Topics 10-20
Handling Complex Conditions with a switch Statement 10-21
Coding Complex Conditions: switch 10-22
switch Statement Syntax 10-23
When to Use switch Constructs 10-24
Exercise 10-3: Using switch Construct 10-25
Quiz 10-26
Topics 10-27
Working with an IDE Debugger 10-28
Debugger Basics 10-29
Setting Breakpoints 10-30
The Debug Toolbar 10-31
Viewing Variables 10-32
Summary 10-33
Challenge Question: Java Puzzle Ball 10-34
Practice 10-1 Overview: Using Conditional Statements 10-35
Practice 10-2 Overview: Debugging 10-36
Interactive Quizzes 11-2
Objectives 11-3
Topics 11-4
Displaying a Date 11-5
Class Names and the Import Statement 11-6
Working with Dates 11-7
Working with Different Calendars 11-9
Some Methods of LocalDate 11-10
Formatting Dates 11-11
Exercise 11-1: Declare a LocalDateTime Object 11-12
Topics 11-13
Using the args Array in the main Method 11-14
Converting String Arguments to Other Types 11-15
Exercise 11-2: Parsing the args Array 11-16
Topics 11-17
Describing Two-Dimensional Arrays 11-18
Declaring a Two-Dimensional Array 11-19
Instantiating a Two-Dimensional Array 11-20
Initializing a Two-Dimensional Array 11-21
Quiz 11-22
Topics 11-23
Some New Types of Loops 11-24
Repeating Behavior 11-25
A while Loop Example 11-26
Coding a while Loop 11-27
while Loop with Counter 11-28
Coding a Standard for Loop 11-29
Standard for Loop Compared to a while loop 11-30
Standard for Loop Compared to an Enhanced for Loop 11-31
do/while Loop to Find the Factorial Value of a Number 11-32
Coding a do/while Loop 11-33
Comparing Loop Constructs 11-34
The continue Keyword 11-35
Exercise 11-3: Processing an Array of Items 11-36
Topics 11-37
Nesting Loops 11-38
Nested for Loop 11-39
Nested while Loop 11-40
Processing a Two-Dimensional Array 11-41
Output from Previous Example 11-42
Quiz 11-43
Topics 11-45
ArrayList Class 11-46
Benefits of the ArrayList Class 11-47
Importing and Declaring an ArrayList 11-48
Working with an ArrayList 11-49
Exercise 11-4: Working with an ArrayList 11-50
Summary 11-51
Play Time! 11-52
Practice 11-1 Overview: Iterating Through Data 11-53
Practice 11-2 Overview: Working with LocalDateTime 11-54
Objectives 12-2
Topics 12-3
Java Puzzle Ball 12-4
Java Puzzle Ball Debrief 12-5
Inheritance in Java Puzzle Ball 12-6
Implementing Inheritance 12-8
More Inheritance Facts 12-9
Topics 12-10
Duke’s Choice Classes: Common Behaviors 12-11
Code Duplication 12-12
Inheritance 12-13
Clothing Class: Part 1 12-14
Shirt Class: Part 1 12-15
Constructor Calls with Inheritance 12-16
xiii
Inheritance and Overloaded Constructors 12-17
Exercise 12-1: Creating a Subclass 12-18
Topics 12-19
More on Access Control 12-20
Overriding Methods 12-21
Review: Duke’s Choice Class Hierarchy 12-22
Clothing Class: Part 2 12-23
Shirt Class: Part 2 12-24
Overriding a Method: What Happens at Run Time? 12-25
Exercise 12-2: Overriding a Method in the Superclass 12-26
Topics 12-27
Polymorphism 12-28
Superclass and Subclass Relationships 12-29
Using the Superclass as a Reference 12-30
Polymorphism Applied 12-31
Accessing Methods Using a Superclass Reference 12-32
Casting the Reference Type 12-33
instanceof Operator 12-34
Exercise 12-3: Using the instanceof Operator 12-35
Topics 12-36
Abstract Classes 12-37
Extending Abstract Classes 12-39
Summary 12-40
Challenge Questions: Java Puzzle Ball 12-41
Practice 12-1 Overview: Creating a Class Hierarchy 12-43
Practice 12-2 Overview: Creating a GameEvent Hierarchy 12-44
Interactive Quizzes 13-2
Objectives 13-3
Topics 13-4
The Object Class 13-5
Calling the toString Method 13-6
Overriding toString in Your Classes 13-7
Topics 13-8
The Multiple Inheritance Dilemma 13-9
The Java Interface 13-10
Multiple Hierarchies with Overlapping Requirements 13-11
Using Interfaces in Your Application 13-12
Implementing the Returnable Interface 13-13
Access to Object Methods from Interface 13-14
xiv
Casting an Interface Reference 13-15
Quiz 13-16
Topics 13-18
The Collections Framework 13-19
ArrayList Example 13-20
List Interface 13-21
Example: Arrays.asList 13-22
Exercise 13-1: Converting an Array to an ArrayList 13-24
Topics 13-25
Example: Modifying a List of Names 13-26
Using a Lambda Expression with replaceAll 13-27
Lambda Expressions 13-28
The Enhanced APIs That Use Lambda 13-29
Lambda Types 13-30
The UnaryOperator Lambda Type 13-31
The Predicate Lambda Type 13-32
Exercise 13-2: Using a Predicate Lambda Expression 13-33
Summary 13-34
Practice 13-1 Overview: Overriding the toString Method 13-35
Practice 13-2 Overview: Implementing an Interface 13-36
Practice 13-3 (Optional) Overview: Using a Lambda Expression for Sorting 13-37
Objectives 14-2
Topics 14-3
What Are Exceptions? 14-4
Examples of Exceptions 14-5
Code Example 14-6
Another Example 14-7
Types of Throwable classes 14-8
Error Example: OutOfMemoryError 14-9
Quiz 14-10
Topics 14-11
Normal Program Execution: The Call Stack 14-12
How Exceptions Are Thrown 14-13
Topics 14-14
Working with Exceptions in NetBeans 14-15
The try/catch Block 14-16
Program Flow When an Exception Is Caught 14-17
When an Exception Is Thrown 14-18
Throwing Throwable Objects 14-19
Uncaught Exception 14-20
Exception Printed to Console 14-21
Summary of Exception Types 14-22
Exercise 14-1: Catching an Exception 14-23
Quiz 14-24
Exceptions in the Java API Documentation 14-25
Calling a Method That Throws an Exception 14-26
Working with a Checked Exception 14-27
Best Practices 14-28
Bad Practices 14-29
Somewhat Better Practice 14-30
Topics 14-31
Multiple Exceptions 14-32
Catching IOException 14-33
Catching IllegalArgumentException 14-34
Catching Remaining Exceptions 14-35
Summary 14-36
Interactive Quizzes 14-37
Practice 14-1 Overview: Adding Exception Handling 14-38
Objectives 15-2
Topics 15-3
Packages 15-4
Packages Directory Structure 15-5
Packages in NetBeans 15-6
Packages in Source Code 15-7
Topics 15-8
SoccerEnhanced.jar 15-9
Set Main Class of Project 15-10
Creating the JAR File with NetBeans 15-11
Topics 15-13
Client/Server Two-Tier Architecture 15-14
Client/Server Three-Tier Architecture 15-15
Topics 15-16
Client/Server Three-Tier Architecture 15-17
Different Outputs 15-19
The Soccer Application 15-20
IDisplayDataItem Interface 15-21
Running the JAR File from the Command Line 15-22
Text Presentation of the League 15-23
Web Presentation of the League 15-24
Topics 15-25
Enhancing the Application 15-26
Adding a New GameEvent Kickoff 15-27
Game Record Including Kickoff 15-28
Summary 15-29
Course Summary 15-30
Agenda 16-2
What is Cloud? 16-3
What is Cloud Computing? 16-4
History – Cloud Evolution 16-5
Components of Cloud Computing 16-6
Characteristics of Cloud 16-7
Cloud Deployment Models 16-8
Cloud Service Models 16-9
Industry Shifting from On-Premises to the Cloud 16-13
Oracle IaaS Overview 16-15
Oracle PaaS Overview 16-16
Oracle SaaS Overview 16-17
Summary 16-18
Objectives 17-2
Oracle Application Container Cloud Service 17-3
Oracle Application Container Cloud 17-4
Polyglot Platform 17-5
Open Platform 17-6
Container-based Application Platform as a Service 17-7
Elastic Scaling 17-8
Profiling 17-9
Manageable 17-10
Deploy—Application Archive (Zip) 17-12
Application Deployment 17-13
Application Container Cloud Architecture 17-14
Load Balancer 17-15
Oracle Developer Cloud Service 17-16
Developer Cloud Service – Easy Adoption/Integration 17-17
Application Container Cloud Service Advantages 17-19
Summary 17-20
Request More Information
Training Options
- ILT: Instructor-Led Training
- VILT: Virtual Instructor-Led Training
Exam & Certification
Oracle Certified Associate, Java SE 8 Programmer
The Java SE 8 Oracle Certified Associate (OCA) certification helps you build a foundational understanding of Java, and gaining this certification credential is the first of two steps in demonstrating you have the high-level skills needed to become a professional Java developer.