Java

Introduction to Computers, Programs, and Java

  • Introduction
  • What Is a Computer?
  • Programming Languages
  • Operating Systems
  • Java, the World Wide Web, and Beyond
  • The Java Language Specification, API, JDK, and IDE
  • A Simple Java Program
  • Creating, Compiling, and Executing a Java Program
  • Programming Style and Documentation
  • Programming Errors
  • Developing Java Programs Using NetBeans
  • Developing Java Programs Using Eclipse 25

Elementary Programming

  • Introduction
  • Writing a Simple Program
  • Reading Input from the Console
  • Identifiers
  • Variables
  • Assignment Statements and Assignment Expressions
  • Named Constants
  • Naming Conventions
  • Numeric Data Types and Operations
  • Numeric Literals
  • Evaluating Expressions and Operator Precedence
  • Case Study: Displaying the Current Time
  • Augmented Assignment Operators
  • Increment and Decrement Operators
  • Numeric Type Conversions
  • Software Development Process
  • Case Study: Counting Monetary Units
  • Common Errors and Pitfalls

Selections

  • Introduction
  • boolean Data Type
  • if Statements
  • Two-Way if-else Statements
  • Nested if and Multi-Way if-else Statements
  • Common Errors and Pitfalls
  • Generating Random Numbers
  • Case Study: Computing Body Mass Index
  • Case Study: Computing Taxes
  • Logical Operators
  • Case Study: Determining Leap Year
  • Case Study: Lottery
  • switch Statements
  • Conditional Expressions
  • Operator Precedence and Associativity
  • Debugging

Mathematical Functions, Characters, and Strings

  • Introduction
  • Common Mathematical Functions
  • Character Data Type and Operations
  • The String Type
  • Case Studies
  • Formatting Console Output

Loops

See Topics ...
  • Introduction
  • The while Loop
  • The do-while Loop
  • The for Loop
  • Which Loop to Use?
  • Nested Loops
  • Minimizing Numeric Errors
  • Case Studies
  • Keywords break and continue
  • Case Study: Checking Palindromes
  • Displaying Prime Numbers

Methods

See Topics ...
  • Introduction
  • Defining a Method
  • Calling a Method
  • void Method Example
  • Passing Arguments by Values
  • Modularizing Code
  • Case Study: Converting Hexadecimals to Decimals
  • Overloading Methods
  • The Scope of Variables
  • Case Study: Generating Random Characters
  • Method Abstraction and Stepwise Refinement

Single-Dimensional Arrays

See Topics ...
  • Introduction
  • Array Basics
  • Case Study: Analyzing Numbers
  • Case Study: Deck of Cards
  • Copying Arrays
  • Passing Arrays to Methods
  • Returning an Array from a Method
  • Case Study: Counting the Occurrences of Each Letter
  • Variable-Length Argument Lists
  • Searching Arrays
  • Sorting Arrays
  • The Arrays Class
  • Command-Line Arguments

Multidimensional Arrays

See Topics ...
  • Introduction
  • Two-Dimensional Array Basics
  • Processing Two-Dimensional Arrays
  • Passing Two-Dimensional Arrays to Methods
  • Case Study: Grading a Multiple-Choice Test
  • Case Study: Finding the Closest Pair
  • Case Study: Sudoku
  • Multidimensional Arrays

Objects and Classes

See Topics ...
  • Introduction
  • Defining Classes for Objects
  • Example: Defining Classes and Creating Objects
  • Constructing Objects Using Constructors
  • Accessing Objects via Reference Variables
  • Using Classes from the Java Library
  • Static Variables, Constants, and Methods
  • Visibility Modifiers
  • Data Field Encapsulation
  • Passing Objects to Methods
  • Array of Objects
  • Immutable Objects and Classes
  • The Scope of Variables
  • The this Reference

Object-Oriented Thinking

See Topics ...
  • Introduction
  • Class Abstraction and Encapsulation
  • Thinking in Objects
  • Class Relationships
  • Case Study: Designing the Course Class
  • Case Study: Designing a Class for Stacks
  • Processing Primitive Data Type Values as Objects
  • Automatic Conversion between Primitive Types and Wrapper Class Types
  • The BigInteger and BigDecimal Classes
  • The String Class
  • The StringBuilder and StringBuffer Classes

Inheritance and Polymorphism

See Topics ...
  • Introduction
  • Superclasses and Subclasses
  • Using the super Keyword
  • Overriding Methods
  • Overriding vs. Overloading
  • The Object Class and Its toString() Method
  • Polymorphism
  • Dynamic Binding
  • Casting Objects and the instanceof Operator
  • The Object’s equals Method
  • The ArrayList Class
  • Useful Methods for Lists
  • Case Study: A Custom Stack Class
  • The protected Data and Methods
  • Preventing Extending and Overriding

Exception Handling and Text I/O

See Topics ...
  • Introduction
  • Exception-Handling Overview
  • Exception Types
  • More on Exception Handling
  • The finally Clause
  • When to Use Exceptions
  • Rethrowing Exceptions
  • Chained Exceptions
  • Defining Custom Exception Classes
  • The File Class
  • File Input and Output
  • Reading Data from the Web
  • Case Study: Web Crawler

Abstract Classes and Interfaces

> See Topics ...
  • Introduction
  • Abstract Classes
  • Case Study: the Abstract Number Class
  • Case Study: Calendar and GregorianCalendar
  • Interfaces
  • The Comparable Interface
  • The Cloneable Interface
  • Interfaces vs. Abstract Classes
  • Case Study: The Rational Class
  • Class Design Guidelines

JavaFX Basics

> See Topics ...
  • Introduction
  • JavaFX vs Swing and AWT
  • The Basic Structure of a JavaFX Program
  • Panes, UI Controls, and Shapes
  • Property Binding
  • Common Properties and Methods for Nodes
  • The Color Class
  • The Font Class
  • The Image and ImageView Classes
  • Layout Panes
  • Shapes
  • Case Study: The ClockPane Class

Event-Driven Programming and Animations

> See Topics ...
  • Introduction
  • Events and Event Sources
  • Registering Handlers and Handling Events
  • Inner Classes
  • Anonymous Inner Class Handlers
  • Simplifying Event Handling Using Lambda Expressions
  • Case Study: Loan Calculator
  • Mouse Events
  • Key Events
  • Listeners for Observable Objects
  • Animation
  • Case Study: Bouncing Ball

JavaFX UI Controls and Multimedia

> See Topics ...
  • Introduction
  • Labeled and Label
  • Button
  • CheckBox
  • RadioButton
  • TextField
  • TextArea
  • ComboBox
  • ListView
  • ScrollBar
  • Slider
  • Case Study: Developing a Tic-Tac-Toe Game
  • Video and Audio
  • Case Study: National Flags and Anthems

Binary I/O

> See Topics ...
  • Introduction
  • How Is Text I/O Handled in Java?
  • Text I/O vs. Binary I/O
  • Binary I/O Classes
  • Case Study: Copying Files
  • Object I/O
  • Random-Access Files

Recursion

> See Topics ...
  • Introduction
  • Case Study: Computing Factorials
  • Case Study: Computing Fibonacci Numbers
  • Problem Solving Using Recursion
  • Recursive Helper Methods
  • Case Study: Finding the Directory Size
  • Case Study: Tower of Hanoi
  • Case Study: Fractals
  • Recursion vs. Iteration

Generics

> See Topics ...
  • Introduction
  • Motivations and Benefits
  • Defining Generic Classes and Interfaces
  • Generic Methods
  • Case Study: Sorting an Array of Objects
  • Raw Types and Backward Compatibility
  • Wildcard Generic Types
  • Erasure and Restrictions on Generics
  • Case Study: Generic Matrix Class

Lists, Stacks, Queues, and Priority Queues

> See Topics ...
  • Introduction
  • Collections
  • Iterators
  • Lists
  • The Comparator Interface
  • Static Methods for Lists and Collections
  • Case Study: Bouncing Balls
  • Vector and Stack Classes
  • Queues and Priority Queues
  • Case Study: Evaluating Expressions

Sets and Maps

> See Topics ...
  • Introduction
  • Sets
  • Comparing the Performance of Sets and Lists
  • Case Study: Counting Keywords
  • Maps
  • Case Study: Occurrences of Words
  • Singleton and Unmodifiable Collections and Maps

Developing Efficient Algorithms

> See Topics ...
  • Introduction
  • Measuring Algorithm Efficiency Using Big O Notation
  • Examples: Determining Big O
  • Analyzing Algorithm Time Complexity
  • Finding Fibonacci Numbers Using Dynamic Programming
  • Finding Greatest Common Divisors Using Euclid's Algorithm
  • Efficient Algorithms for Finding Prime Numbers
  • Finding the Closest Pair of Points Using Divide-and-Conquer
  • Solving the Eight Queens Problem Using Backtracking 846 22.10 Computational Geometry: Finding a Convex Hull

Sorting

> See Topics ...
  • Introduction
  • Insertion Sort
  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Bucket Sort and Radix Sort
  • External Sort

Implementing Lists, Stacks, Queues, and Priority Queues

> See Topics ...
  • Introduction
  • Common Features for Lists
  • Array Lists
  • Linked Lists
  • Stacks and Queues
  • Priority Queues

Binary Search Trees

> See Topics ...
  • Introduction
  • Binary Search Trees
  • Deleting Elements from a BST
  • Tree Visualization and MVC
  • Iterators
  • Case Study: Data Compression

AVL Trees

> See Topics ...
  • Introduction
  • Rebalancing Trees
  • Designing Classes for AVL Trees
  • Overriding the insert Method
  • Implementing Rotations
  • Implementing the delete Method
  • The AVLTree Class
  • Testing the AVLTree Class
  • AVL Tree Time Complexity Analysis

Hashing

> See Topics ...
  • Introduction
  • What Is Hashing?
  • Hash Functions and Hash Codes
  • Handling Collisions Using Open Addressing
  • Handling Collisions Using Separate Chaining
  • Load Factor and Rehashing
  • Implementing a Map Using Hashing
  • Implementing Set Using Hashing

Graphs and Applications

> See Topics ...
  • Introduction
  • Basic Graph Terminologies
  • Representing Graphs
  • Modeling Graphs
  • Graph Visualization
  • Graph Traversals
  • Depth-First Search (DFS)
  • Case Study: The Connected Circles Problem
  • Breadth-First Search (BFS)
  • Case Study: The Nine Tails Problem

Weighted Graphs and Applications

> See Topics ...
  • Introduction
  • Representing Weighted Graphs
  • The WeightedGraph Class
  • Minimum Spanning Trees
  • Finding Shortest Paths
  • Case Study: The Weighted Nine Tails Problem

Multithreading and Parallel Programming

> See Topics ...
  • Introduction
  • Thread Concepts
  • Creating Tasks and Threads
  • The Thread Class
  • Case Study: Flashing Text
  • Thread Pools
  • Thread Synchronization
  • Synchronization Using Locks
  • Cooperation among Threads
  • Case Study: Producer/Consumer
  • Blocking Queues
  • Semaphores
  • Avoiding Deadlocks
  • Thread States
  • Synchronized Collections
  • Parallel Programming

Networking

> See Topics ...
  • Introduction
  • Client/Server Computing
  • The InetAddress Class
  • Serving Multiple Clients
  • Sending and Receiving Objects
  • Case Study: Distributed Tic-Tac-Toe Games

Java Database Programming

> See Topics ...
  • Introduction
  • Relational Database Systems
  • SQL
  • JDBC
  • PreparedStatement
  • CallableStatement
  • Retrieving Metadata

JavaServer Faces

> See Topics ...
  • Introduction
  • Getting Started with JSF
  • JSF GUI Components
  • Processing the Form
  • Case Study: Calculator
  • Session Tracking
  • Validating Input
  • Binding Database with Facelets
  • Opening New JSF Pages