Book description
The Java® Tutorial, 6th Edition, is based on the Java Platform, Standard Edition (Java SE) 8. This revised and updated edition introduces the new features added to the platform, including lambda expressions, default methods, aggregate operations, and more. An accessible and practical guide for programmers of any level, this book focuses on how to use the rich environment provided by Java to build applications, applets, and components.
Expanded coverage includes a chapter on the Date-Time API and a new chapter on annotations, with sections on type annotations and pluggable type systems as well as repeating annotations.
In addition, the updated sections “Security in Rich Internet Applications” and “Guidelines for Securing Rich Internet Applications” address key security topics. The latest deployment best practices are described in the chapter “Deployment in Depth.”
If you plan to take one of the Java SE 8 certification exams, this book can help. A special appendix, “Preparing for Java Programming Language Certification,” details the items covered on the available exams. Check online for updates.
All of the material has been thoroughly reviewed by members of Oracle Java engineering to ensure that the information is accurate and up to date. This book is based on the online tutorial hosted on Oracle Corporation’s website at http://docs.oracle.com/javase/tutorial.
Table of contents
- About This eBook
- Title Page
- Copyright Page
- Preface
- About the Authors
- 1. Getting Started
- 2. Object-Oriented Programming Concepts
- 3. Language Basics
-
4. Classes and Objects
- Classes
- Objects
- More on Classes
-
Nested Classes
- Why Use Nested Classes?
- Static Nested Classes
- Inner Classes
- Shadowing
- Serialization
- Inner Class Example
- Local and Anonymous Classes
- Modifiers
- Local Classes
- Anonymous Classes
- Lambda Expressions
- When to Use Nested Classes, Local Classes, Anonymous Classes, and Lambda Expressions
- Questions and Exercises: Nested Classes
- Enum Types
- 5. Annotations
-
6. Interfaces and Inheritance
- Interfaces
-
Inheritance
- The Java Platform Class Hierarchy
- An Example of Inheritance
- What You Can Do in a Subclass
- Private Members in a Superclass
- Casting Objects
- Multiple Inheritance of State, Implementation, and Type
- Overriding and Hiding Methods
- Polymorphism
- Hiding Fields
- Using the Keyword super
- Object as a Superclass
- Writing Final Classes and Methods
- Abstract Methods and Classes
- Summary of Inheritance
- Questions and Exercises: Inheritance
-
7. Generics
- Why Use Generics?
- Generic Types
- Generic Methods
- Bounded Type Parameters
- Generics, Inheritance, and Subtypes
- Type Inference
- Wildcards
- Type Erasure
-
Restrictions on Generics
- Cannot Instantiate Generic Types with Primitive Types
- Cannot Create Instances of Type Parameters
- Cannot Declare Static Fields Whose Types Are Type Parameters
- Cannot Use Casts or instanceof with Parameterized Types
- Cannot Create Arrays of Parameterized Types
- Cannot Create, Catch, or Throw Objects of Parameterized Types
- Cannot Overload a Method Where the Formal Parameter Types of Each Overload Erase to the Same Raw Type
- Questions and Exercises: Generics
- 8. Packages
- 9. Numbers and Strings
- 10. Exceptions
-
11. Basic I/O and NIO.2
- I/O Streams
-
File I/O (Featuring NIO.2)
- What Is a Path? (And Other File System Facts)
- The Path Class
- File Operations
- Checking a File or Directory
- Deleting a File or Directory
- Copying a File or Directory
- Moving a File or Directory
- Managing Metadata (File and File Store Attributes)
- Reading, Writing, and Creating Files
- Random Access Files
- Creating and Reading Directories
- Links, Symbolic or Otherwise
- Walking the File Tree
- Finding Files
- Watching a Directory for Changes
- Other Useful Methods
- Legacy File I/O Code
- Summary
- Questions and Exercises: Basic I/O
-
12. Collections
- Introduction to Collections
-
Interfaces
- The Collection Interface
- Traversing Collections
- Collection Interface Bulk Operations
- Collection Interface Array Operations
- The Set Interface
- The List Interface
- The Queue Interface
- The Deque Interface
- The Map Interface
- Object Ordering
- The SortedSet Interface
- The SortedMap Interface
- Summary of Interfaces
- Questions and Exercises: Interfaces
- Aggregate Operations
- Implementations
- Algorithms
- Custom Collection Implementations
- Interoperability
- 13. Concurrency
- 14. Regular Expressions
- 15. The Platform Environment
- 16. Packaging Programs in JAR Files
- 17. Java Web Start
-
18. Applets
- Getting Started with Applets
-
Doing More with Applets
- Finding and Loading Data Files
- Defining and Using Applet Parameters
- Displaying Short Status Strings
- Displaying Documents in the Browser
- Invoking JavaScript Code from an Applet
- Invoking Applet Methods from JavaScript Code
- Handling Initialization Status with Event Handlers
- Manipulating DOM of Applet’s Web Page
- Displaying a Customized Loading Progress Indicator
- Writing Diagnostics to Standard Output and Error Streams
- Developing Draggable Applets
- Communicating with Other Applets
- Working with a Server-Side Application
- What Applets Can and Cannot Do
-
Solving Common Applet Problems
- “My Applet Does Not Display”
- “The Java Console Log Displays java.lang.ClassNotFoundException”
- “I Was Able to Build the Code Once, but Now the Build Fails Even Though There Are No Compilation Errors”
- “When I Try to Load a Web Page That Has an Applet, My Browser Redirects Me to www.java.com without Any Warning”
- “I Fixed Some Bugs and Rebuilt My Applet’s Source Code. When I Reload the Applet’s Web Page, My Fixes Are Not Showing Up”
- Questions and Exercises: Applets
- 19. Doing More with Java Rich Internet Applications
- 20. Deployment in Depth
-
21. Date-Time
- Date-Time Overview
- Date-Time Design Principles
- The Date-Time Packages
- Method Naming Conventions
- Standard Calendar
- Overview
- DayOfWeek and Month Enums
- Date Classes
- Date and Time Classes
- Time Zone and Offset Classes
- Instant Class
- Parsing and Formatting
- The Temporal Package
- Period and Duration
- Clock
- Non-ISO Date Conversion
- Legacy Date-Time Code
- Summary
- Questions and Exercises: Date-Time
- 22. Introduction to JavaFX
-
Appendix. Preparation for Java Programming Language Certification
-
Programmer Level I Exam
- Section 1: Java Basics
- Section 2: Working with Java Data Types
- Section 3: Using Operators and Decision Constructs
- Section 4: Creating and Using Arrays
- Section 5: Using Loop Constructs
- Section 6: Working with Methods and Encapsulation
- Section 7: Working with Inheritance
- Section 8: Handling Exceptions
- Section 9: Working with Selected Classes from the Java API
- Programmer Level II Exam
-
Java SE 8 Upgrade Exam
- Section 1: Lambda Expressions
- Section 2: Using Built-In Lambda Types
- Section 3: Filtering Collections with Lambdas
- Section 4: Collection Operations with Lambda
- Section 5: Parallel Streams
- Section 6: Lambda Cookbook
- Section 7: Method Enhancements
- Section 8: Use Java SE 8 Date/Time API
- Section 9: JavaScript on Java with Nashorn
-
Programmer Level I Exam
- Index
- Code Snippets
Product information
- Title: The Java® Tutorial: A Short Course on the Basics, 6th Edition
- Author(s):
- Release date: December 2014
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780134034706
You might also like
book
Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The
"This is a book that deserves a prominent place by anyone who aspires to be a …
article
Reinventing the Organization for GenAI and LLMs
Previous technology breakthroughs did not upend organizational structure, but generative AI and LLMs will. We now …
book
リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック
美しいコードを見ると感動する。優れたコードは見た瞬間に何をしているかが伝わってくる。そういうコードは使うのが楽しいし、自分のコードもそうあるべきだと思わせてくれる。本書の目的は、君のコードを良くすることだ。(本書「はじめに」より) コードは理解しやすくなければならない。本書はこの原則を日々のコーディングの様々な場面に当てはめる方法を紹介します。名前の付け方、コメントの書き方など表面上の改善について。コードを動かすための制御フロー、論理式、変数などループとロジックについて。またコードを再構成するための方法。さらにテストの書き方などについて、楽しいイラストと共に説明しています。日本語版ではRubyやgroongaのコミッタとしても著名な須藤功平氏による解説を収録。
article
Three Ways to Sell Value in B2B Markets
As customers face pressure to reduce costs while maintaining profitability, value-based selling (VBS) has become critical …