Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Introduction
Java, the Language and the Technology
An Overview of Object-Oriented Programming
About This Book
Downloading Program Examples and Answers
Chapter 1: Getting Started
Downloading and Installing Java
Your First Java Program
Java Code Conventions
Integrated Development Environments (IDEs)
Summary
Quiz
Chapter 2: Language Fundamentals
ASCII and Unicode
Separators
Primitives
Variables
Constants
Literals
Primitive Conversions
Operators
Comments
Summary
Quiz
Chapter 3: Statements
Overview
The if Statement
The while Statement
The do-while Statement
The for Statement
The break Statement
The continue Statement
The switch Statement
Summary
Quiz
Chapter 4: Objects and Classes
What Is An Object?
Java Classes
Creating An Object
The null Keyword
Memory Allocation for Objects
Java Packages
Encapsulation and Access Control
The this Keyword
Using Other Classes
Final Variables
Static Members
Static Final Variables
Static import
Variable Scope
Method Overloading
Static Factory Methods
By Value or By Reference?
Loading, Linking, and Initialization
Object Creation Initialization
The Garbage Collector
Summary
Quiz
Chapter 5: Core Classes
java.lang.Object
java.lang.String
java.lang.StringBuffer and java.lang.StringBuilder
Primitive Wrappers
java.lang.Class
java.lang.System
java.util.Scanner
Summary
Quiz
Chapter 6: Arrays
Overview
Iterating over an Array
The java.util.Arrays Class
Changing an Array Size
Searching An Array
Passing a String Array to main
Multidimensional Arrays
Summary
Quiz
Chapter 7: Inheritance
Overview
Accessibility
Method Overriding
Calling the Constructors of the Superclass
Calling the Hidden Members of the Superclass
Type Casting
Final Classes
The instanceof Operator
Summary
Quiz
Chapter 8: Error Handling
Catching Exceptions
try without catch
Catching Multiple Exceptions
The try-with-resources Statement
The java.lang.Exception Class
Throwing an Exception from a Method
User-Defined Exceptions
Note on Exception Handling
Summary
Quiz
Chapter 9: Working with Numbers
Boxing and Unboxing
Number Parsing
Number Formatting
Number Parsing with java.text.NumberFormat
The java.lang.Math Class
Working with Money
Generating Random Numbers
Summary
Quiz
Chapter 10: Interfaces and Abstract Classes
The Concept of Interface
The Interface, Technically Speaking
Default Methods
Static Methods
Base Classes
Abstract Classes
Summary
Quiz
Chapter 11: Polymorphism
Overview
Polymorphism in Action
Polymorphism and Reflection
Summary
Quiz
Chapter 12: Enums
Overview
Enums in a Class
The java.lang.Enum Class
Iterating Enumerated Values
Switching on Enum
Enum Members
Summary
Quiz
Chapter 13: Working with Dates and Times
Overview
The Instant Class
LocalDate
Period
LocalDateTime
Time Zones
ZonedDateTime
Duration
Formatting A Date-Time
Parsing A Date-Time
Using the Old Date and Time API
Summary
Quiz
Chapter 14: The Collections Framework
An Overview of the Collections Framework
The Collection Interface
List and ArrayList
Iterating Over a Collection with Iterator and for
Set and HashSet
Queue and LinkedList
Collection Conversion
Map and HashMap
Making Objects Comparable and Sortable
Summary
Quiz
Chapter 15: Generics
Life without Generics
Generic Types
Using Generic Types without Type Parameters
Using the ? Wildcard
Using Bounded Wildcards in Methods
Generic Methods
Writing Generic Types
Summary
Quiz
Chapter 16: Input/Output
File Systems and Paths
File and Directory Handling and Manipulation
Input/Output Streams
Reading Binary Data
Writing Binary Data
Writing Text (Characters)
Reading Text (Characters)
Logging with PrintStream
Random Access Files
Object Serialization
Summary
Quiz
Chapter 17: Annotations
Overview
Standard Annotations
Common Annotations
Standard Meta-Annotations
Custom Annotation Types
Summary
Quiz
Chapter 18: Nested and Inner Classes
An Overview of Nested Classes
Static Nested Classes
Member Inner Classes
Local Inner Classes
Anonymous Inner Classes
Behind Nested and Inner Classes
Summary
Quiz
Chapter 19: Lambda Expressions
Why Lambda Expressions?
Functional Interfaces
Lambda Expression Syntax
Predefined Functional Interfaces
Method References
Optional and Similar Classes
Summary
Quiz
Chapter 20: Working with Streams
Overview
Creating and Obtaining a Stream
Concatenating Streams
Filtering
Mapping
Reduction
Mutable Reductions
Parallel Streams
Summary
Quiz
Chapter 21: Java Database Connectivity
Introduction to JDBC
Four Steps to Data Access
Using Java DB
Using the DAO Pattern
Reading Metadata
Summary
Quiz
Chapter 22: Swing Basics
Overview
AWT Components
Useful AWT Classes
Basic Swing Components
Summary
Quiz
Chapter 23: Swinging Higher
Layout Managers
Event Handling
Working with Menus
The Look and Feel
Fast Splash Screens
System Tray Support
Desktop Help Applications
Summary
Quiz
Chapter 24: Applets
A Brief History of Applets
The Applet API
Security Restrictions
Writing and Deploying Applets
How AppletViewer Works
Passing Parameters to an Applet
SoundPlayerApplet
JApplet
Applet Deployment in a JAR File
Faster Loading
Summary
Quiz
Chapter 25: Introduction to JavaFX
Overview
Setting up
Your First JavaFX Application
The JavaFX API is explained in the next section.Application, Stage, and Scene
UI Components
Controls
Regions
Event Handling
Styling with CSS
Summary
Quiz
Chapter 26: JavaFX with FXML
Overview
A Simple FXML-Based Application
Event Handling with FXML
Summary
Quiz
Chapter 27: Java Threads
Introduction to Java Threads
Creating a Thread
Working with Multiple Threads
Thread Priority
Stopping a Thread
Synchronization
Visibility
Thread Coordination
Using Timers
Swing Timers
Summary
Quiz
Chapter 28: Concurrency Utilities
Atomic Variables
Executor and ExecutorService
Callable and Future
Swing Worker
Locks
Summary
Quiz
Chapter 29: Internationalization
Locales
Internationalizing Applications
An Internationalized Swing Application
Summary
Quiz
Chapter 30: Java Networking
An Overview of Networking
The Hypertext Transfer Protocol (HTTP)
java.net.URL
java.net.URLConnection
java.net.Socket
java.net.ServerSocket
A Web Server Application
Summary
Quiz
Chapter 31: Security
Java Security Overview
Using the Security Manager
Policy Files
Permissions
Using the Policy Tool
Applet Security
Programming with Security
Cryptography Overview
Creating Certificates
The KeyTool Program
The JarSigner Tool
Java Cryptography API
Summary
Quiz
Chapter 32: Java Web Applications
Servlet Application Architecture
Servlet API Overview
Servlet
Writing a Basic Servlet Application
ServletRequest
ServletResponse
ServletConfig
ServletContext
GenericServlet
HTTP Servlets
Using the Deployment Descriptor
Summary
Quiz
Chapter 33: JavaServer Pages
A JSP Overview
jspInit, jspDestroy, and Other Methods
Implicit Objects
JSP Syntactic Elements
Handling Errors
Summary
Quiz
Chapter 34: Javadoc
Overview
Writing Documentation in Java Classes
Javadoc Syntax
Summary
Quiz
Chapter 35: Application Deployment
JWS Overview
JNLP File Syntax
A Deployment Example
Security Concerns
Summary
Quiz
Appendix A: javac
Options
Command Line Argument Files
Appendix B: java
Options
Appendix C: jar
Syntax
Options
Examples
Setting an Application Entry Point
Appendix D: NetBeans
Download and Installation
Creating a Project
Creating a Class
Running a Java Class
Adding Libraries
Debugging Code
Appendix E: Eclipse
Download and Installation
Adding A JRE
Creating a Java Project
Creating a Class
Running a Java Class
Adding Libraries
Debugging Code
Useful Shortcuts
Answers
Chapter 1: Getting Started
Chapter 2: Language Fundamentals
Chapter 3: Statements
Chapter 4: Objects and Classes
Chapter 5: Core Classes
Chapter 6: Arrays
Chapter 7: Inheritance
Chapter 8: Error Handling
Chapter 9: Working with Numbers
Chapter 10: Interfaces and Abstract Classes
Chapter 11: Polymorphism
Chapter 12: Enums
Chapter 13: Working with Dates and Times
Chapter 14: The Collections Framework
Chapter 15: Generics
Chapter 16: Input Output
Chapter 17: Annotations
Chapter 18: Inner Classes
Chapter 19: Lambda Expressions
Chapter 20: Working with Streams
Chapter 21: Java Database Connectivity
Chapter 22: Swing Basics
Chapter 23: Swinging Higher
Chapter 24: Applets
Chapter 25: Introduction to JavaFX
Chapter 26: JavaFX with FXML
Chapter 27: Java Threads
Chapter 28: Concurrency Utilities
Chapter 29: Internationalization
Chapter 30: Java Networking
Chapter 31: Security
Chapter 32: Java Web Applications
Chapter 33: JavaServer Pages
Chapter 34: Javadoc
Chapter 35: Application Deployment
← Prev
Back
Next →
← Prev
Back
Next →