Résumé
Based on the second editions of The Java™ Language Specification and The Java™ Virtual Machine Specification, Java™ Rules presents a subset of those specifications in a gentle tutorial style. From platform basics to APIs, this encyclopedic guidebook reveals every facet of the language—including previously undocumented features. Throughout the book, practical tutorials are supported with official language documentation or with insights shared by respected leaders. The book's unique format and conversational style are ideally suited for experienced programmers seeking a short path to language proficiency.
As both a tutorial and detailed reference, this volume of Java™ Rules covers:
- Lexical structure, escape sequences, and positional notation systems
- The anatomy of a compilation unit
- The five kinds of classes and interfaces
- Containment and inner class hierarchies (versus inheritance hierarchies)
- The static modifier, this and super
- Primitive data types and Object
- Strings and other common data types
- Arrays and the Collections Framework
With Java™ Rules in hand, both novices and experienced programmers canlanguage.
Contents
Preface.
About This Book.
A Java Tradition.
1. Lexical Structure.
White Space.
Comments.
Identifiers.
Keywords.
Literals.
Escape Sequences.
String Literals.
Numeric Literals.
Class Literals.
Separators.
Operators.
2. Compilation Units.
The Terminology of Class Body Declarations.
Recognizing Constructors in Source Code.
Anatomy of a Compilation Unit.
The Significance of Textual Order.
Limit of One “public” Package Member.
Package Declarations.
The Members of a Package.
Using the SDK to Develop Packages.
Import Declarations.
Redundant Imports.
Importing Nested Classes of All Sorts (Top-Level or Inner).
How Import Declarations are Used by a Compiler.
The Efficiency of Type-Import-on-Demand Declarations.
Type Declarations.
Interface Type Declarations.
The Definition of Top-Level Classes.
Helper Classes are Not Fundamentally Different.
The Five Kinds of Classes and Interfaces.
Non-“public” Member Classes.
Local and Anonymous Classes.
Nested Interfaces.
Choosing Which Kind of Class to Use.
The Rationale for Containment and Inner Class Hierarchies.
Containment and Inner Class Hierarchies.
Inner Class Hierarchies.
3. The “static” Modifier, “this,” and “super” .
The “static” Modifier.
“static” Methods.
“static” Classes.
The Definition of “static” Context.
The “this” and “super” Keywords.
The Direct Superclass (“super” ).
Practical Uses of the “this” and “super” Keywords.
Multiple Current Instances (a.k.a. Levels).
Qualifying the “this” Keyword.
Qualifying the “new” Keyword.
Qualifying the “super” Keyword.
4. Primitive Data Types and Object.
The Definition of Data Types.
The Object-Oriented Definition of Type.
Numeric Data Types.
Floating-Point Types.
Understanding the Floating-Point Types.
The “char” Data Type.
The “boolean” Data Type.
The “null” Type.
The “Number” Class.
The “java.math” Package.
The “BigDecimal” Class.
Currency Calculations.
Rounding the Result of a Floating-Point Operation.
Using Integral Types to Store Monetary Values.
Primitive Type Wrapper Classes.
Converting Primitive Numeric Types to Strings.
Bit Pattern Manipulation.
Accessing Primitive Type System Properties.
Unicode Utility Methods.
The “Object” Class.
Understanding Hash Tables.
The Five Housekeeping Methods.
The Comparison Methods.
What is Natural Ordering?
Reverse Order (or Descending) Sorts.
Sorting By More Than One Field.
The “Comparable” Interface.
The “Comparator” Interface.
5. Strings and Other Common Data Types.
Would-Be Mutator Methods.
The Length of a “String” or “StringBuffer” .
The Capacity of a “StringBuffer” .
“String” Indices.
Checked Exceptions in String and “StringBuffer” .
The “String” Class.
Comparing Strings.
Accessing Individual Characters or Substrings.
“char” to “String” Conversions and Vice Versa.
Translating Locally Encoded Strings.
Miscellaneous Methods in the “String” Class.
Unusual Constructors in the “String” Class.
The “StringBuffer” Class.
Other Methods in the “StringBuffer” Class.
Other String-Related Classes.
The “StringReader” and “StringWriter” Classes.
Lexical Analysis.
The “StringTokenizer” Class.
The “StreamTokenizer” Class.
String Concatenation Operations.
Implicit String Conversions.
The Intern Mechanism.
Shared Character Buffers.
Displaying Diagnostic Messages on the Console.
The “print” and “println” Methods.
The Locale” Class.
Supported Locales.
The “Date” Class.
The “GregorianCalendar” Class.
The Inconsistent Field Rule.
The Maximum DAY_OF_MONTH Rule.
Date and Time Fields in the Calendar Class.
Normalizing Date and Time Fields.
Date and Time Field Manipulation Methods.
The “TimeZone” Class.
Understanding the Difference between i18n and l10n.
The Localization of Common Data Types.
Formatting Dates and Times.
6. Arrays and The Collections Framework.
Array, Component, and Element Types.
Arrays.
Array Classes Are Dynamically Created.
The Members of an Array Type.
Array Type Variable Declarations.
Initializing Array Type Variables.
Array Access Expressions.
A Bridge over Troubled Waters (the “toArray” Methods).
Untyped References versus Parameterized Types.
Time Complexities (or Big-O Notation).
Amortized Constant Time.
Logarithmic Time.
Linear Time.
Quadratic Time.
The Equivalence Relationship and Elements.
Duplicate Elements.
The Collections Framework.
The Principle of Maximum Generality.
The “Collection” Interface.
The Map Interface.
Housekeeping Methods for Containers.
General-Purpose Implementations.
Performance Tuning the General-Purpose Implementations.
Special-Purpose Implementations.
Views.
Unmodifiable Views.
Range Views (Sublists, Subsets, and Submaps).
Collection Views of a Map.
List View of an Array.
Iterators.
Using Collection Views to Iterate over a Map.
A Poor Man's Collection.
Synchronized Iterators.
Fail-Fast Iterators.
Iterating Backwards Through a “TreeSet” or “TreeMap” .
Al-Khwarizmi Concerning the Hindu Art of Reckoning.
Utility Methods for “Arrays” and Other “Collections” .
Searching.
Cloning versus Copying a Container.
Shuffling.
Filling.
The Minimum and Maximum Elements.
Convenience Implementations.
An “equals” Method for Arrays.
Custom Implementations of the Core Collection Interfaces.
Optional Operations.
Restricted Containers.
Standard Constructors.
Multimaps and Multidimensional Arrays.
Multidimensional Arrays.
Legacy Containers.
Index.
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Addison Wesley |
Auteur(s) | Douglas Dunn |
Parution | 02/11/2001 |
Nb. de pages | 688 |
Format | 18,6 x 23,2 |
Couverture | Broché |
Poids | 1045g |
Intérieur | Noir et Blanc |
EAN13 | 9780201709162 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse