Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Table of Contents
Introduction
About This Book
Foolish Assumptions
Icons Used in This Book
Beyond the Book
Where to Go from Here
Book 1: Java Basics
Chapter 1: Welcome to Java
What Is Java, and Why Is It So Great?
Java versus Other Languages
Important Features of the Java Language
On the Downside: Java’s Weaknesses
Java Version Insanity
What’s in a Name?
Chapter 2: Installing and Using Java Tools
Downloading and Installing the Java Development Kit
Using Java’s Command-Line Tools
Using Java Documentation
Chapter 3: Working with TextPad
Downloading and Installing TextPad
Editing Source Files
Compiling a Program
Running a Java Program
Book 2: Programming Basics
Chapter 1: Java Programming Basics
Looking at the Infamous Hello, World! Program
Dealing with Keywords
Working with Statements
Working with Blocks
Creating Identifiers
Crafting Comments
Introducing Object-Oriented Programming
Importing Java API Classes
Chapter 2: Working with Variables and Data Types
Declaring Variables
Initializing Variables
Using Final Variables (Constants)
Working with Primitive Data Types
Working with Strings
Converting and Casting Numeric Data
Thinking Inside the Box
Understanding Scope
Shadowing Variables
Printing Data with System.out
Getting Input with the Scanner Class
Getting Input with the JOptionPane Class
Using enum to Create Your Own Data Types
Chapter 3: Working with Numbers and Expressions
Working with Arithmetic Operators
Dividing Integers
Combining Operators
Using the Unary Plus and Minus Operators
Using Increment and Decrement Operators
Using the Assignment Operator
Using Compound Assignment Operators
Using the Math Class
Formatting Numbers
Recognizing Weird Things about Java Math
Chapter 4: Making Choices
Using Simple Boolean Expressions
Using if Statements
Using Mr. Spock’s Favorite Operators (Logical Ones, of Course)
Using the Conditional Operator
Comparing Strings
Chapter 5: Going Around in Circles (Or, Using Loops)
Using Your Basic while Loop
Breaking Out of a Loop
Looping Forever
Using the continue Statement
Running do-while Loops
Validating Input from the User
Using the Famous for Loop
Nesting Your Loops
Chapter 6: Pulling a Switcheroo
Battling else-if Monstrosities
Using the switch Statement
Creating Character Cases
Intentionally Leaving Out a Break Statement
Switching with Strings
Chapter 7: Adding Some Methods to Your Madness
The Joy of Methods
The Basics of Making Methods
Methods That Return Values
Methods That Take Parameters
Chapter 8: Handling Exceptions
Understanding Exceptions
Catching Exceptions
Handling Exceptions with a Preemptive Strike
Catching All Exceptions at Once
Displaying the Exception Message
Using a finally Block
Handling Checked Exceptions
Throwing Your Own Exceptions
Catching Multiple Exceptions
Book 3: Object-Oriented Programming
Chapter 1: Understanding Object-Oriented Programming
What Is Object-Oriented Programming?
Understanding Objects
Understanding the Life Cycle of an Object
Working with Related Classes
Designing a Program with Objects
Diagramming Classes with UML
Chapter 2: Making Your Own Classes
Declaring a Class
Working with Members
Using Getters and Setters
Overloading Methods
Creating Constructors
Finding More Uses for the this Keyword
Using Initializers
Chapter 3: Working with Statics
Understanding Static Fields and Methods
Working with Static Fields
Using Static Methods
Counting Instances
Preventing Instances
Using Static Initializers
Chapter 4: Using Subclasses and Inheritance
Introducing Inheritance
Creating Subclasses
Overriding Methods
Protecting Your Members
Using this and super in Your Subclasses
Understanding Inheritance and Constructors
Using final
Casting Up and Down
Determining an Object’s Type
Poly What?
Creating Custom Exceptions
Chapter 5: Using Abstract Classes and Interfaces
Using Abstract Classes
Using Interfaces
More Things You Can Do with Interfaces
Using Default Methods
Chapter 6: Using the Object and Class Classes
The Mother of All Classes: Object
The toString Method
The equals Method
The clone Method
The Class Class
Chapter 7: Using Inner Classes, Anonymous Classes, and Lambda Expressions
Declaring Inner Classes
Using Static Inner Classes
Using Anonymous Inner Classes
Using Lambda Expressions
Chapter 8: Working with Packages and the New Java Module System
Working with Packages
Putting Your Classes in a JAR File
Using JavaDoc to Document Your Classes
Using the Java Module System
Book 4: Strings, Arrays, and Collections
Chapter 1: Working with Strings
Reviewing Strings
Using the String Class
Using the StringBuilder and StringBuffer Classes
Using the CharSequence Interface
Chapter 2: Using Arrays
Understanding Arrays
Creating Arrays
Initializing an Array
Using for Loops with Arrays
Solving Homework Problems with Arrays
Using the Enhanced for Loop
Using Arrays with Methods
Using Two-Dimensional Arrays
Working with a Fun but Complicated Example: A Chessboard
Using the Arrays Class
Chapter 3: Using the ArrayList Class
Understanding the ArrayList Class
Creating an ArrayList Object
Adding Elements
Accessing Elements
Printing an ArrayList
Using an Iterator
Updating Elements
Deleting Elements
Chapter 4: Using the LinkedList Class
Understanding the LinkedList Class
Creating a LinkedList
Adding Items to a LinkedList
Retrieving Items from a LinkedList
Updating LinkedList Items
Removing LinkedList Items
Chapter 5: Creating Generic Collection Classes
Why Generics?
Creating a Generic Class
A Generic Stack Class
Using Wildcard-Type Parameters
A Generic Queue Class
Using the Diamond Operator
Chapter 6: Using Bulk Data Operations with Collections
Looking At a Basic Bulk Data Operation
Looking Closer at the Stream Interface
Using Parallel Streams
Book 5: Programming Techniques
Chapter 1: Programming Threads
Understanding Threads
Creating a Thread
Implementing the Runnable Interface
Creating Threads That Work Together
Using an Executor
Synchronizing Methods
Creating a Lock
Coping with Threadus Interruptus
Chapter 2: Using Regular Expressions
Creating a Program for Experimenting with Regular Expressions
Performing Basic Character Matching
Using Regular Expressions in Java Programs
Chapter 3: Using Recursion
Calculating the Classic Factorial Example
Displaying Directories
Writing Your Own Sorting Routine
Chapter 4: Working with Dates and Times
Pondering How Time is Represented
Picking the Right Date and Time Class for Your Application
Using the now Method to Create a Date-Time Object
Using the parse Method to Create a Date-Time Object
Using the of Method to Create a Date-Time Object
Looking Closer at the LocalDate Class
Extracting Information About a Date
Comparing Dates
Calculating with Dates
Formatting Dates
Looking at a Fun Birthday Calculator
Book 6: JavaFX
Chapter 1: Hello, JavaFX!
Perusing the Possibilities of JavaFX
Looking at a Simple JavaFX Program
Importing JavaFX Packages
Extending the Application Class
Launching the Application
Overriding the start Method
Creating a Button
Handling an Action Event
Creating a Layout Pane
Making a Scene
Setting the Stage
Examining the Click Counter Program
Chapter 2: Handling Events
Examining Events
Handling Events
Implementing the EventHandler Interface
Handling Events with Inner Classes
Handling Events with Anonymous Inner Classes
Using Lambda Expressions to Handle Events
Chapter 3: Setting the Stage and Scene Layout
Examining the Stage Class
Examining the Scene Class
Switching Scenes
Creating an Alert Box
Exit, Stage Right
Chapter 4: Using Layout Panes to Arrange Your Scenes
Working with Layout Panes
Using the HBox Layout
Spacing Things Out
Adding Space with Margins
Adding Space by Growing Nodes
Using the VBox Layout
Aligning Nodes in a Layout Pane
Making Nodes the Same Width
Using the Flow Layout
Using the Border Layout
Using the GridPane Layout
Chapter 5: Getting Input from the User
Using Text Fields
Validating Numeric Data
Using Check Boxes
Using Radio Buttons
Looking at a Pizza Order Application
Chapter 6: Choosing from a List
Using Choice Boxes
Working with Observable Lists
Listening for Selection Changes
Using Combo Boxes
Using List Views
Using Tree Views
Book 7: Web Programming
Chapter 1: Using Java Web Start
Looking at a Simple JavaFX Program
Understanding Java Web Start
Creating a JNLP File
Creating an HTML File to Launch a Java Application
Uploading the Java Web Start Files to Your Web Server
Launching the ClickMe Application Using Java Web Start
Creating an Exception to Allow Java Web Start Applications to Run
Chapter 2: Creating Servlets
Understanding Servlets
Using Tomcat
Creating a Simple Servlet
Running a Servlet
Improving the HelloWorld Servlet
Getting Input from the User
Using Classes in a Servlet
Chapter 3: Using JavaServer Pages
Understanding JavaServer Pages
Using Page Directives
Using Expressions
Using Scriptlets
Using Declarations
Using Classes
Chapter 4: Using JavaBeans
Getting to Know JavaBeans
Looking Over a Sample Bean
Using Beans with JSP Pages
Scoping Your Beans
Book 8: Files and Databases
Chapter 1: Working with Files
Using the File Class
Using Command-Line Parameters
Choosing Files in a Swing Application
Using Path Objects
Using a File Visitor to Walk a File Tree
Chapter 2: Working with File Streams
Understanding Streams
Reading Character Streams
Writing Character Streams
Reading Binary Streams
Writing Binary Streams
Chapter 3: Database for $100, Please
Defining a Relational Database
Understanding (and Pronouncing) SQL
Introducing SQL Statements
Creating a SQL Database
Querying a Database
Updating and Deleting Rows
Chapter 4: Using JDBC to Connect to a Database
Setting Up a Driver
Connecting to a Database
Querying a Database
Updating SQL Data
Using an Updatable RowSet Object
Chapter 5: Working with XML
Defining XML
Using a DTD
Processing XML in Two Ways: DOM and SAX
Reading a DOM Document
Reading DOM Nodes
Putting It All Together: A Program That Lists Movies
About the Author
Advertisement Page
Connect with Dummies
End User License Agreement
← Prev
Back
Next →
← Prev
Back
Next →