t
t
t
t
t t   b) Avant-propos
tttt
t
carrea) Préface b) Avant-propos carre1) Introduction sur les &laqo; objets » carre2) Tout est &laqo; objet » carre3) Contrôle du flux du programme carre4) Initialization & Cleanup carre5) Cacher l'implémentation carre6) Réutiliser les classes carre7) Polymorphisme carre8) Interfaces & classes internes carre9) Stockage des objets carre10) Error Handling with Exceptions carre11) Le système d’E/S de Java carre12) Identification dynamique de type carre13) Création de fenêtres & d'Applets carre14) Les &laqo; Threads » multiples carre15) Informatique distribuée carreA) Passage et retour d'objets carreB) L'Interface Java Natif (JNI) carreC) Conseils pour une programation stylée en Java carreD) Resources
Texte original t Traducteur : Jean-Pierre Vidal
t
t
///
Ce chapitre contient 2 pages
1 2
    
t t t
t t t
t
t t t
Appendix C: Java Programming Guidelines
t Annexe C : Conseils pour une Programmation Stylée en Java
t t t
This appendix contains suggestions to help guide you while performing low-level program design and writing code.
t Cet annexe est un ensemble de suggestions qui vous aideront dans la conception et le codage de bas niveau de votre application.
t t t
Appendix D: Recommended Reading
t Annexe D : Ressources
t t t
A list of some of the Java books I’ve found particularly useful.
t Une liste des livres sur Java que m'ont paru particulièrement utile.
t t t

Exercises

t

Exercices

t t t
I’ve discovered that simple exercises are exceptionally useful to complete a student’s understanding during a seminar, so you’ll find a set at the end of each chapter.
t Je me suis aperçu que des exercices simples sont très utiles pour consolider les connaissances des étudiants lors d'un séminaire, on en trouvera donc un ensemble à la fin de chaque chapitre.
t t t
Most exercises are designed to be easy enough that they can be finished in a reasonable amount of time in a classroom situation while the instructor observes, making sure that all the students are absorbing the material. Some exercises are more advanced to prevent boredom for experienced students. The majority are designed to be solved in a short time and test and polish your knowledge. Some are more challenging, but none present major challenges. (Presumably, you’ll find those on your own—or more likely they’ll find you).
t La plupart d'entre eux sont conçus afin d'être assez simples pour être réalisés dans un temps raisonnable dans le contexte d'une salle de classe, pendant que l'instructeur vérifie que tous les étudiants ont assimilé le sujet de la leçon. Quelques exercices sont plus pointus, afin d'éviter l'ennui chez les étudiants expérimentés. La majorité est conçue pour être réalisés rapidement, ainsi que pour tester et perfectionner les connaissances. Quelques-uns présentent des difficultés, mais jamais de difficulté majeure. (Je présume que vous les découvrirez par vous-même — ou plutôt qu'ils vous trouveront).
t t t
Solutions to selected exercises can be found in the electronic document The Thinking in Java Annotated Solution Guide, available for a small fee from www.BruceEckel.com.
t Les solutions des exercices se trouvent dans le document électronique The Thinking in Java Annotated Solution Guide, disponible pour un faible coût sur http://www.BruceEckel.com.
t t t

Multimedia CD ROM

t

Le CD ROM Multimédia

t t t
There are two multimedia CDs associated with this book. The first is bound into the book itself: Thinking in C, described at the end of the preface, which prepares you for the book by bringing you up to speed on the necessary C syntax you need to be able to understand Java.
t Deux CD ROM multimédia sont associés à ce livre. Le premier est fourni avec le livre lui-même : Thinking in C, décrit à la fin de la préface, et consiste en une préparation à ce livre qui décrit la syntaxe C nécessaire à la compréhension de Java.
t t t
A second Multimedia CD ROM is available, which is based on the contents of the book. This CD ROM is a separate product and contains the entire contents of the week-long “Hands-On Java” training seminar. This is more than 15 hours of lectures that I have recorded, synchronized with hundreds of slides of information. Because the seminar is based on this book, it is an ideal accompaniment.
t Il existe un deuxième CD ROM Multimédia, basé sur le contenu du livre. Ce CD ROM est un produit séparé et contient la totalité du séminaire d'une semaine de formation Java « Hands-On Java ». J'y ai enregistré plus de 15 heures de conférence, synchronisées avec des centaines de diapositives d'information. C'est un accompagnement idéal, dans la mesure où le séminaire est basé sur ce livre.
t t t
The CD ROM contains all the lectures (with the important exception of personalized attention!) from the five-day full-immersion training seminars. We believe that it sets a new standard for quality.
t Le CD ROM contient toutes les conférences du séminaire de formation en immersion totale de cinq jours (il ne traite pas de l'attention portée aux cas particuliers !). Nous espérons que cela définira un nouveau standard de qualité.
t t t
The Hands-On Java CD ROM is available only by ordering directly from the Web site www.BruceEckel.com.
t Le CD ROM « Hands-On Java » est uniquement disponible en le commandant directement sur le site http://www.BruceEckel.com.
t t t

Source code

t

Le Code Source

t t t
All the source code for this book is available as copyrighted freeware, distributed as a single package, by visiting the Web site www.BruceEckel.com. To make sure that you get the most current version, this is the official site for distribution of the code and the electronic version of the book. You can find mirrored versions of the electronic book and the code on other sites (some of these sites are found at www.BruceEckel.com), but you should check the official site to ensure that the mirrored version is actually the most recent edition. You may distribute the code in classroom and other educational situations.
t L'ensemble du code source de ce livre est disponible en freeware sous copyright, en une seule archive, en visitant le site Web http://www.BruceEckel.com. Afin que vous soyez certains d'obtenir la dernière version, cette adresse est celle du site officiel pour la distribution du code et de la version électronique du livre. Il existe des versions miroir du livre électronique et du code sur d'autres sites (dont certains sont référencés sur le site http://www.BruceEckel.com), mais il est préférable de rendre visite au site officiel afin de s'assurer que la version miroir est la plus récente. Vous êtes autorisés à distribuer le code à des fins d'enseignement ou d'éducation.
t t t
The primary goal of the copyright is to ensure that the source of the code is properly cited, and to prevent you from republishing the code in print media without permission. (As long as the source is cited, using examples from the book in most media is generally not a problem.)
t Le but essentiel du copyright est d'assurer que la source du code soit correctement citée, et d'éviter que le code soit utilisé sans autorisation dans un médium imprimé. (Tant que la source est citée, l'utilisation d'exemples provenant du livre ne pose généralement pas problème).
t t t
In each source code file you will find a reference to the following copyright notice:
t Chaque code source contient une référence à l'annonce suivante du copyright :
t t t
//:! :CopyRight.txt Copyright ©2000 Bruce Eckel Source code file from the 2nd edition of the book Thinking in Java. All rights reserved EXCEPT as allowed by the following statements: You can freely use this file for your own work (personal or commercial), including modifications and distribution in executable form only. Permission is granted to use this file in classroom situations, including its use in presentation materials, as long as the book Thinking in Java is cited as the source. Except in classroom situations, you cannot copy and distribute this code; instead, the sole distribution point is http://www.BruceEckel.com (and official mirror sites) where it is freely available. You cannot remove this copyright and notice. You cannot distribute modified versions of the source code in this package. You cannot use this file in printed media without the express permission of the author. Bruce Eckel makes no representation about the suitability of this software for any purpose. It is provided as is without express or implied warranty of any kind, including any implied warranty of merchantability, fitness for a particular purpose or non-infringement. The entire risk as to the quality and performance of the software is with you. Bruce Eckel and the publisher shall not be liable for any damages suffered by you or any third party as a result of using or distributing software. In no event will Bruce Eckel or the publisher be liable for any lost revenue, profit, or data, or for direct, indirect, special, consequential, incidental, or punitive damages, however caused and regardless of the theory of liability, arising out of the use of or inability to use software, even if Bruce Eckel and the publisher have been advised of the possibility of such damages. Should the software prove defective, you assume the cost of all necessary servicing, repair, or correction. If you think you've found an error, please submit the correction using the form you will find at www.BruceEckel.com. (Please use the same form for non-code errors found in the book.) ///:~ t
//:!:CopyRight.txt
Copyright ©2000 Bruce Eckel
Source code file from the 2nd edition of the book
"Thinking in Java." All rights reserved EXCEPT as
allowed by the following statements:
You can freely use this file
for your own work (personal or commercial),
including modifications and distribution in
executable form only. Permission is granted to use
this file in classroom situations, including its
use in presentation materials, as long as the book
"Thinking in Java" is cited as the source.
Except in classroom situations, you cannot copy
and distribute this code; instead, the sole
distribution point is http://www.BruceEckel.com
(and official mirror sites) where it is
freely available. You cannot remove this
copyright and notice. You cannot distribute
modified versions of the source code in this
package. You cannot use this file in printed
media without the express permission of the
author. Bruce Eckel makes no representation about
the suitability of this software for any purpose.
It is provided "as is" without express or implied
warranty of any kind, including any implied
warranty of merchantability, fitness for a
particular purpose or non-infringement. The entire
risk as to the quality and performance of the
software is with you. Bruce Eckel and the
publisher shall not be liable for any damages
suffered by you or any third party as a result of
using or distributing software. In no event will
Bruce Eckel or the publisher be liable for any
lost revenue, profit, or data, or for direct,
indirect, special, consequential, incidental, or
punitive damages, however caused and regardless of
the theory of liability, arising out of the use of
or inability to use software, even if Bruce Eckel
and the publisher have been advised of the
possibility of such damages. Should the software
prove defective, you assume the cost of all
necessary servicing, repair, or correction. If you
think you've found an error, please submit the
correction using the form you will find at
www.BruceEckel.com. (Please use the same
form for non-code errors found in the book.)
///:~
t t t
You may use the code in your projects and in the classroom (including your presentation materials) as long as the copyright notice that appears in each source file is retained.
t Vous êtes autorisés à utiliser le code pour vos projets ainsi qu'à des fins d'éducation (ceci incluant vos cours) à la condition de conserver le copyright inclus dans chaque fichier source.
t t t

Coding standards

t

Typographie et style de code

t t t
In the text of this book, identifiers (function, variable, and class names) are set in bold. Most keywords are also set in bold, except for those keywords that are used so much that the bolding can become tedious, such as “class.”
t Dans ce livre, les identificateurs (de fonction, de variable, de nom de classe) sont écrits en gras. La plupart des mots clefs sont également en gras, à l'exception de ceux qui sont si souvent utilisés, tels que « class », que cela en deviendrait ennuyeux.
t t t
I use a particular coding style for the examples in this book. This style follows the style that Sun itself uses in virtually all of the code you will find at its site (see java.sun.com/docs/codeconv/index.html), and seems to be supported by most Java development environments. If you’ve read my other works, you’ll also notice that Sun’s coding style coincides with mine—this pleases me, although I had nothing to do with it. The subject of formatting style is good for hours of hot debate, so I’ll just say I’m not trying to dictate correct style via my examples; I have my own motivation for using the style that I do. Because Java is a free-form programming language, you can continue to use whatever style you’re comfortable with.
t J'utilise un style de code particulier pour les exemples de ce livre. Ce style suit les règles que Sun utilise lui-même dans pratiquement tous les codes que l'on peut trouver sur son site (voir java.sun.com/docs/codeconv/index.html), et semble être pris en compte par la plupart des environnements de développement Java. Si vous avez lu mes autres livres, vous avez pu remarquer que le style de codage de Sun coïncide avec le mien — ce qui me fait évidemment plaisir, bien que je n'y sois pour rien. Le sujet du style de format demanderait des heures de débat assez chaud, aussi je vais simplement dire que je ne prétends pas imposer un style correct au travers de mes exemples, j'ai seulement mes propres motivations pour faire ainsi. Puisque Java est un langage de programmation indépendant de la forme, vous pouvez continuer à utiliser le style qui vous convient.
t t t
The programs in this book are files that are included by the word processor in the text, directly from compiled files. Thus, the code files printed in the book should all work without compiler errors. The errors that should cause compile-time error messages are commented out with the comment //! so they can be easily discovered and tested using automatic means. Errors discovered and reported to the author will appear first in the distributed source code and later in updates of the book (which will also appear on the Web site www.BruceEckel.com).
t Les programmes de ce livre sont des fichiers directement inclus, au moyen du traitement de texte, depuis des fichiers ayant déjà subi une compilation. Par suite, le code imprimé dans le livre ne doit pas provoquer d'erreurs de compilation. Les erreurs qui pourraient entraîner des messages d'erreur lors de la compilation sont mis en commentaires au moyen de //! de manière à être facilement repérées et testées par des moyens automatiques. Les erreurs découvertes et rapportées à l'auteur feront d'abord l'objet d'une modification du code source distribué, puis, plus tard, d'une révision du livre (qui sera également disponible sur le site Web http://www.BruceEckel.com).
t t t

Java versions

t

Les versions de Java

t t t
I generally rely on the Sun implementation of Java as a reference when determining whether behavior is correct.
t Je me réfère généralement à l'implémentation Sun de Java pour déterminer la démarche correcte.
t t t
Over time, Sun has released three major versions of Java: 1.0, 1.1 and 2 (which is called version 2 even though the releases of the JDK from Sun continue to use the numbering scheme of 1.2, 1.3, 1.4, etc.). Version 2 seems to finally bring Java into the prime time, in particular where user interface tools are concerned. This book focuses on and is tested with Java 2, although I do sometimes make concessions to earlier features of Java 2 so that the code will compile under Linux (via the Linux JDK that was available at this writing).
t Depuis le début, Sun a fourni trois versions majeures de Java : 1.0, 1.1 et 2 (laquelle est appelée version 2 même si les versions du JDK de Sun continuent à être numérotées 1.2, 1.3, 1.4, etc.). La version 2 semble définitivement mettre Java en lumière, en particulier lorsqu'il est question des outils d'interface utilisateur. Ce livre en parle et a été testé avec Java 2, bien que je fasse de temps en temps des concessions aux fonctionnalités futures de Java 2 afin que le code soit compilable sous Linux (avec le JDK Linux disponible alors que j'écrivais ceci).
t t t
If you need to learn about earlier releases of the language that are not covered in this edition, the first edition of the book is freely downloadable at www.BruceEckel.com and is also contained on the CD that is bound in with this book.
t Si vous désirez apprendre les versions antérieures du langage non couvertes par cette édition, la première édition de ce livre est librement téléchargeable à l'adresse url : http://www.BruceEckel.com, vous la trouverez également dans le CD livré avec ce livre.
t t t
One thing you’ll notice is that, when I do need to mention earlier versions of the language, I don’t use the sub-revision numbers. In this book I will refer to Java 1.0, Java 1.1, and Java 2 only, to guard against typographical errors produced by further sub-revisioning of these products.
t Attention : lorsqu'il m'a fallu mentionner les versions antérieures du langage, je n'utilise pas les numéros de sous-révision. Dans ce livre je fais uniquement référence à Java 1.0, Java 1.1, et Java 2, afin de me prémunir contre les erreurs typographiques qui pourraient résulter de futures sous-révisions de ces produits.
t t t

Seminars and mentoring

t

Seminars and mentoring

t t t
My company provides five-day, hands-on, public and in-house training seminars based on the material in this book. Selected material from each chapter represents a lesson, which is followed by a monitored exercise period so each student receives personal attention. The audio lectures and slides for the introductory seminar are also captured on CD ROM to provide at least some of the experience of the seminar without the travel and expense. For more information, go to www.BruceEckel.com.
t (non traduit, les personnes intéressées par les séminaires de Bruce Eckel devant à priori maîtriser l'anglais) My company provides five-day, hands-on, public and in-house training seminars based on the material in this book. Selected material from each chapter represents a lesson, which is followed by a monitored exercise period so each student receives personal attention. The audio lectures and slides for the introductory seminar are also captured on CD ROM to provide at least some of the experience of the seminar without the travel and expense. For more information, go to http://www.BruceEckel.com.
t t t
My company also provides consulting, mentoring and walkthrough services to help guide your project through its development cycle—especially your company’s first Java project.
t My company also provides consulting, mentoring and walkthrough services to help guide your project through its development cycle — especially your company's first Java project.
t t t

Errors

t

Errors

t t t
No matter how many tricks a writer uses to detect errors, some always creep in and these often leap off the page for a fresh reader.
t (non traduit car cela concerne les erreurs relevées dans la version anglaise du livre de Bruce Eckel) No matter how many tricks a writer uses to detect errors, some always creep in and these often leap off the page for a fresh reader.
t t t
There is an error submission form linked from the beginning of each chapter in the HTML version of this book (and on the CD ROM bound into the back of this book, and downloadable from www.BruceEckel.com) and also on the Web site itself, on the page for this book. If you discover anything you believe to be an error, please use this form to submit the error along with your suggested correction. If necessary, include the original source file and note any suggested modifications. Your help is appreciated.
t There is an error submission form linked from the beginning of each chapter in the HTML version of this book (and on the CD ROM bound into the back of this book, and downloadable from http://www.BruceEckel.com) and also on the Web site itself, on the page for this book. If you discover anything you believe to be an error, please use this form to submit the error along with your suggested correction. If necessary, include the original source file and note any suggested modifications. Your help is appreciated.
t t t

Note on the cover design

t

À propos de la conception de la couverture du livre

t t t
The cover of Thinking in Java is inspired by the American Arts & Crafts Movement, which began near the turn of the century and reached its zenith between 1900 and 1920. It began in England as a reaction to both the machine production of the Industrial Revolution and the highly ornamental style of the Victorian era. Arts & Crafts emphasized spare design, the forms of nature as seen in the art nouveau movement, hand-crafting, and the importance of the individual craftsperson, and yet it did not eschew the use of modern tools. There are many echoes with the situation we have today: the turn of the century, the evolution from the raw beginnings of the computer revolution to something more refined and meaningful to individual persons, and the emphasis on software craftsmanship rather than just manufacturing code.
t La couverture de Thinking in Java est inspirée par le Mouvement des Arts et Métiers Américain (American Arts & Crafts Movement), qui commença peu avant le XXe siècle et atteignit son zénith entre 1900 et 1920. Il vit le jour en Angleterre en réaction à la fois contre la production des machines de la Révolution Industrielle et contre le style hautement ornemental de l'ère Victorienne. Arts & Crafts mit l'accent sur la sobriété, les formes de la nature telles que les voyait le mouvement « art nouveau" (en français dans le texte, NdT), le travail manuel, et l'importance des travailleurs et artisans particuliers, et encore n'ont-ils pas dédaigné l'utilisation des outils modernes. Il y a beaucoup de ressemblances avec la situation actuelle : le tournant du siècle, l'évolution des débuts inexpérimentés de la révolution informatique vers quelque chose de plus raffiné et significatif pour les individus, et l'engouement pour la connaissance du métier de programmeur face à la fabrication industrielle de code.
t t t
I see Java in this same way: as an attempt to elevate the programmer away from an operating-system mechanic and toward being a “software craftsman.”
t Je considère Java de la même manière : une tentative pour élever le programmeur au-dessus de la mécanique du système d'exploitation afin de l'amener à devenir un « artisan du logiciel ».
t t t
Both the author and the book/cover designer (who have been friends since childhood) find inspiration in this movement, and both own furniture, lamps, and other pieces that are either original or inspired by this period.
t L'auteur, tout autant que le concepteur du livre et de sa couverture (qui sont amis depuis l'enfance) ont trouvé leur inspiration dans ce mouvement, et tous deux possèdent des meubles, lampes etc. soit originaux, soit inspirés par cette période.
t t t
The other theme in this cover suggests a collection box that a naturalist might use to display the insect specimens that he or she has preserved. These insects are objects, which are placed within the box objects. The box objects are themselves placed within the “cover object,” which illustrates the fundamental concept of aggregation in object-oriented programming. Of course, a programmer cannot help but make the association with “bugs,” and here the bugs have been captured and presumably killed in a specimen jar, and finally confined within a small display box, as if to imply Java’s ability to find, display, and subdue bugs (which is truly one of its most powerful attributes).
t L'autre thème de cette couverture suggère une boîte servant à la présentation des spécimens d'insectes recueillis par un naturaliste. Ces insectes sont des objets, qui sont placés dans des boîtes-objets. Les boîtes-objets sont elles-mêmes placées dans la « couverture-objet », ce qui illustre le concept fondamental d'agrégation en programmation orientée objet. Bien entendu, ceci n'est d'aucune utilité pour un programmeur, mais crée une association avec les « punaises » (« bugs »), ici les punaises ont été capturées, probablement tuées dans un bocal à spécimen, et pour finir confinées dans une petite boîte pour être exposées, comme pour montrer la capacité de Java à trouver, montrer, et soumettre les bugs (ce qui est vraiment l'un de ses attributs les plus puissants).
t t t

Acknowledgements

t

Remerciements

t t t
First, thanks to associates who have worked with me to give seminars, provide consulting, and develop teaching projects: Andrea Provaglio, Dave Bartlett (who also contributed significantly to Chapter 15), Bill Venners, and Larry O’Brien. I appreciate your patience as I continue to try to develop the best model for independent folks like us to work together. Thanks to Rolf André Klaedtke (Switzerland); Martin Vlcek, Martin Byer, Vlada & Pavel Lahoda, Martin the Bear, and Hanka (Prague); and Marco Cantu (Italy) for hosting me on my first self-organized European seminar tour.
t En premier, merci à tous les associés qui travaillèrent avec moi pour encadrer des séminaires, faire du consulting, et développer des projets éducatifs  : Andrea Provaglio, Dave Bartlett (qui a par ailleurs fortement contribué au Chapitre 15), Bill Venners, et Larry O'Brien. J'ai apprécié leur patience alors que je continuais de développer le meilleur modèle permettant à des personnes indépendantes comme nous de travailler ensemble. Merci à Rolf André Klaedtke (Suisse) ; Martin Vlcek, Martin Byer, Vlada & Pavel Lahoda, Martin the Bear, et Hanka (Prague) ; ainsi que Marco Cantu (Italie) pour leur hébergement lors de ma première tournée de conférences improvisée en Europe.
t t t
Thanks to the Doyle Street Cohousing Community for putting up with me for the two years that it took me to write the first edition of this book (and for putting up with me at all). Thanks very much to Kevin and Sonda Donovan for subletting their great place in gorgeous Crested Butte, Colorado for the summer while I worked on the first edition of the book. Also thanks to the friendly residents of Crested Butte and the Rocky Mountain Biological Laboratory who make me feel so welcome.
t Merci aussi à la « Doyle Street Cohousing Community » pour m'avoir supporté durant les deux années nécessaires à la rédaction de cette première édition (ainsi que pour m'avoir supporté dans l'absolu). Bien des remerciements à Kevin et Sonda Donovan pour m'avoir accueilli dans leur magnifique Crested Butte, Colorado, l'été où je travaillais à la première édition du livre. Merci aussi à tous les amis résidents de « Crested Butte » et au « Rocky Mountain Biological Laboratory » qui m'ont si bien accueilli.
t t t
Thanks to Claudette Moore at Moore Literary Agency for her tremendous patience and perseverance in getting me exactly what I wanted.
t Merci également à Claudette Moore de « Moore Literary Agency » pour son énorme patience et sa constance à m'obtenir exactement ce je désirais.
t t t
My first two books were published with Jeff Pepper as editor at Osborne/McGraw-Hill. Jeff appeared at the right place and the right time at Prentice-Hall and has cleared the path and made all the right things happen to make this a very pleasant publishing experience. Thanks, Jeff—it means a lot to me.
t Mes deux premiers livres ont été publiés sous la houlette de l'éditeur Jeff Pepper aux éditions Osborne/McGraw-Hill. Jeff est arrivé au bon endroit au bon moment à Prentice-Hall, il a débroussaillé le chemin et fait tout ce qu'il fallait pour rendre cette expérience de publication très agréable. Merci, Jeff — cela a compté pour moi.
t t t
I’m especially indebted to Gen Kiyooka and his company Digigami, who graciously provided my Web server for the first several years of my presence on the Web. This was an invaluable learning aid.
t J'ai une dette spéciale envers Gen Kiyooka et sa compagnie Digigami, qui m'ont gracieusement fourni un serveur Web les premières années. Cela a représenté pour moi une aide inestimable.
t t t
Thanks to Cay Horstmann (co-author of Core Java, Prentice-Hall, 2000), D’Arcy Smith (Symantec), and Paul Tyma (co-author of Java Primer Plus, The Waite Group, 1996), for helping me clarify concepts in the language.
t Merci à Cay Horstmann (co-auteur de Core Java, Prentice-Hall, 2000), D'Arcy Smith (Symantec), et Paul Tyma (co-auteur de Java Primer Plus, The Waite Group, 1996), pour m'avoir aidé à clarifier les concepts du langage.
t t t
Thanks to people who have spoken in my Java track at the Software Development Conference, and students in my seminars, who ask the questions I need to hear in order to make the material more clear.
t Merci aux personnes qui ont pris la parole dans mon cursus Java à la Software Development Conference, aux étudiants de mes séminaires, pour m'avoir posé les bonnes questions qui m'ont permis de clarifier mes cours.
t t t
Special thanks to Larry and Tina O’Brien, who helped turn my seminar into the original Hands-On Java CD ROM. (You can find out more at www.BruceEckel.com.)
t Je remercie spécialement Larry et Tina O'Brien, qui m'ont aidé à mettre mon séminaire sur le CD ROM original Hands-On Java (vous en saurez davantage sur http://www.BruceEckel.com).
t t t
Lots of people sent in corrections and I am indebted to them all, but particular thanks go to (for the first edition): Kevin Raulerson (found tons of great bugs), Bob Resendes (simply incredible), John Pinto, Joe Dante, Joe Sharp (all three were fabulous), David Combs (many grammar and clarification corrections), Dr. Robert Stephenson, John Cook, Franklin Chen, Zev Griner, David Karr, Leander A. Stroschein, Steve Clark, Charles A. Lee, Austin Maher, Dennis P. Roth, Roque Oliveira, Douglas Dunn, Dejan Ristic, Neil Galarneau, David B. Malkovsky, Steve Wilkinson, and a host of others. Prof. Ir. Marc Meurrens put in a great deal of effort to publicize and make the electronic version of the first edition of the book available in Europe.
t Beaucoup de gens m'ont envoyé des correctifs et je reste en dette avec eux, mais je dois remercier particulièrement (pour la première édition) : Kevin Raulerson (qui repéra des tonnes d'énormes bugs), Bob Resendes (tout simplement incroyable), John Pinto, Joe Dante, Joe Sharp (les trois, fabuleux), David Combs (beaucoup de corrections grammaticales et d'éclaircissements), Dr. Robert Stephenson, John Cook, Franklin Chen, Zev Griner, David Karr, Leander A. Stroschein, Steve Clark, Charles A. Lee, Austin Maher, Dennis P. Roth, Roque Oliveira, Douglas Dunn, Dejan Ristic, Neil Galarneau, David B. Malkovsky, Steve Wilkinson, ainsi qu'une foule d'autres. Prof. Ir. Marc Meurrens déploya beaucoup d'efforts de publication et réalisa la version électronique de la première édition du livre disponible en Europe.
t t t
There have been a spate of smart technical people in my life who have become friends and have also been both influential and unusual in that they do yoga and practice other forms of spiritual enhancement, which I find quite inspirational and instructional. They are Kraig Brockschmidt, Gen Kiyooka, and Andrea Provaglio, (who helps in the understanding of Java and programming in general in Italy, and now in the United States as an associate of the MindView team).
t J'ai rencontré dans ma vie une avalanche de personnes très techniques et très intelligentes qui sont devenues des amis mais qui étaient également peu communes et qui m'ont influencé en ce qu'elles pratiquaient le yoga ainsi que d'autres formes de spiritualité, ce qui m'a instruit et inspiré. Ce sont Kraig Brockschmidt, Gen Kiyooka, et Andrea Provaglio (qui aida à la compréhension de Java et de la programmation en général en Italie, et qui est maintenant aux Etats-Unis associé à l'équipe MindView).
t t t
It’s not that much of a surprise to me that understanding Delphi helped me understand Java, since there are many concepts and language design decisions in common. My Delphi friends provided assistance by helping me gain insight into that marvelous programming environment. They are Marco Cantu (another Italian—perhaps being steeped in Latin gives one aptitude for programming languages?), Neil Rubenking (who used to do the yoga/vegetarian/Zen thing until he discovered computers), and of course Zack Urlocker, a long-time pal whom I’ve traveled the world with.
t Ce ne fut pas une grande surprise pour moi de découvrir que ma connaissance de Delphi m'a aidé à comprendre Java, car ces deux langages ont beaucoup de concepts et de décisions de conception de langage en commun. Des amis fanatiques de Delphi m'ont aidé à devenir plus perspicace à propos de ce merveilleux environnement de programmation. Ce sont Marco Cantu (un autre italien — il se pourrait qu'être imprégné de culture latine donne certaines aptitudes pour la programmation ?), Neil Rubenking (qui se nourrissait de culture yoga/végétarienne/Zen avant de découvrir les ordinateurs), et bien entendu Zack Urlocker, un vieux copain avec qui j'ai parcouru le monde.
t t t
My friend Richard Hale Shaw’s insights and support have been very helpful (and Kim’s, too). Richard and I spent many months giving seminars together and trying to work out the perfect learning experience for the attendees. Thanks also to KoAnn Vikoren, Eric Faurot, Marco Pardi, and the rest of the cast and crew at MFI. Thanks especially to Tara Arrowood, who re-inspired me about the possibilities of conferences.
t La perspicacité et l'aide de mon ami Richard Hale Shaw m'ont été fort utiles (celles de Kim également). Richard et moi avons passé de concert beaucoup de mois à donner des séminaires et à tenter de trouver l'enseignement parfait pour les auditeurs. Merci également à KoAnn Vikoren, Eric Faurot, Marco Pardi, ainsi qu'à toute l'équipe du MFI. Merci particulièrement à Tara Arrowood, qui me rendit confiance à propos des possibilités de conférences.
t t t
The book design, cover design, and cover photo were created by my friend Daniel Will-Harris, noted author and designer (www.Will-Harris.com), who used to play with rub-on letters in junior high school while he awaited the invention of computers and desktop publishing, and complained of me mumbling over my algebra problems. However, I produced the camera-ready pages myself, so the typesetting errors are mine. Microsoft® Word 97 for Windows was used to write the book and to create camera-ready pages in Adobe Acrobat; the book was created directly from the Acrobat PDF files. (As a tribute to the electronic age, I happened to be overseas both times the final version of the book was produced—the first edition was sent from Capetown, South Africa and the second edition was posted from Prague). The body typeface is Georgia and the headlines are in Verdana. The cover typeface is ITC Rennie Mackintosh.
t La conception du livre, de la couverture, ainsi que la photo de couverture sont dûs à mon ami Will-Harris, auteur et concepteur connu (http://www.Will-Harris.com), qui jouait au collège avec des lettres transfert en attendant l'invention de la publication assistée par ordinateur, tout en se plaignant de mes grognements à propos de mes problèmes d'algèbre. Toutefois, j'ai produit moi-même mes pages prêtes à imprimer, et donc j'assume mes erreurs de frappe. Microsoft® Word 97 for Windows a été utilisé pour écrire le livre et Adobe Acrobat pour créer les pages offset ; le livre est sorti directement des fichiers PDF d'Acrobat (pour rendre hommage à l'ère électronique, je me trouvais outre-mer les deux fois où la version finale du livre fut produite — la première édition fut envoyée depuis Le Cap en Afrique du Sud et la seconde depuis Prague). Les polices de caractères sont Georgia pour le corps du texte et Verdana pour les titres. La police de couverture est ITC Rennie Mackintosh.
t t t
Thanks to the vendors who created the compilers: Borland, the Blackdown group (for Linux), and of course, Sun.
t Merci aux groupes qui ont créé les compilateurs : Borland, le Blackdown group (pour Linux), et bien entendu, Sun.
t t t
A special thanks to all my teachers and all my students (who are my teachers as well). The most fun writing teacher was Gabrielle Rico (author of Writing the Natural Way, Putnam, 1983). I’ll always treasure the terrific week at Esalen.
t Je remercie particulièrement tous mes maîtres et tous mes étudiants (qui furent en même temps mes maîtres). Le plus plaisant de mes maîtres en écriture fut Gabrielle Rico (auteur de Writing the Natural Way, Putnam, 1983). Je garderai précieusement le souvenir d'une formidable semaine à Esalen.
t t t
The supporting cast of friends includes, but is not limited to: Andrew Binstock, Steve Sinofsky, JD Hildebrandt, Tom Keffer, Brian McElhinney, Brinkley Barr, Bill Gates at Midnight Engineering Magazine, Larry Constantine and Lucy Lockwood, Greg Perry, Dan Putterman, Christi Westphal, Gene Wang, Dave Mayer, David Intersimone, Andrea Rosenfield, Claire Sawyers, more Italians (Laura Fallai, Corrado, Ilsa, and Cristina Giustozzi), Chris and Laura Strand, the Almquists, Brad Jerbic, Marilyn Cvitanic, the Mabrys, the Haflingers, the Pollocks, Peter Vinci, the Robbins Families, the Moelter Families (and the McMillans), Michael Wilk, Dave Stoner, Laurie Adams, the Cranstons, Larry Fogg, Mike and Karen Sequeira, Gary Entsminger and Allison Brody, Kevin Donovan and Sonda Eastlack, Chester and Shannon Andersen, Joe Lordi, Dave and Brenda Bartlett, David Lee, the Rentschlers, the Sudeks, Dick, Patty, and Lee Eckel, Lynn and Todd, and their families. And of course, Mom and Dad.
t Liste non exhaustive de mes collaborateurs : Andrew Binstock, Steve Sinofsky, JD Hildebrandt, Tom Keffer, Brian McElhinney, Brinkley Barr, Bill Gates au Midnight Engineering Magazine, Larry Constantine et Lucy Lockwood, Greg Perry, Dan Putterman, Christi Westphal, Gene Wang, Dave Mayer, David Intersimone, Andrea Rosenfield, Claire Sawyers, d'autres italiens (Laura Fallai, Corrado, Ilsa, et Cristina Giustozzi), Chris et Laura Strand, les Almquists, Brad Jerbic, Marilyn Cvitanic, les Mabrys, les Haflingers, les Pollocks, Peter Vinci, la famille Robbins, la famille Moelter (ainsi que les McMillans), Michael Wilk, Dave Stoner, Laurie Adams, les Cranstons, Larry Fogg, Mike et Karen Sequeira, Gary Entsminger et Allison Brody, Kevin Donovan et Sonda Eastlack, Chester et Shannon Andersen, Joe Lordi, Dave et Brenda Bartlett, David Lee, les Rentschlers, les Sudeks, Dick, Patty, et Lee Eckel, Lynn et Todd, et leurs familles. Et, bien entendu, Papa et Maman.
t t t

Internet contributors

t

Collaborateurs Internet

t t t
Thanks to those who helped me rewrite the examples to use the Swing library, and for other assistance: Jon Shvarts, Thomas Kirsch, Rahim Adatia, Rajesh Jain, Ravi Manthena, Banu Rajamani, Jens Brandt, Nitin Shivaram, Malcolm Davis, and everyone who expressed support. This really helped me jump-start the project.
t Merci à tous ceux qui m'ont aidé à réécrire les exemples au moyen de la bibliothèque Swing, ou pour d'autres choses : Jon Shvarts, Thomas Kirsch, Rahim Adatia, Rajesh Jain, Ravi Manthena, Banu Rajamani, Jens Brandt, Nitin Shivaram, Malcolm Davis, ainsi qu'à tous ceux qui se sont exprimés. Cela m'a réellement aidé à mettre le projet à jour.
t t t
t t t
t t
\\\
    
t t t
t
     
Sommaire Le site de Bruce Eckel