Java Programming

Páginas: 183 (45566 palabras) Publicado: 8 de agosto de 2011
Effective Java: Programming Language Guide

Joshua Bloch Publisher: Addison Wesley First Edition June 01, 2001 ISBN: 0-201-31005-8, 272 pages

Are you ready for a concise book packed with insight and wisdom not found elsewhere? Do you want to gain a deeper understanding of the Java programming language? Do you want to write code that is clear, correct, robust, and reusable? Look nofurther! This book will provide you with these and many other benefits you may not even know you were looking for. Featuring fifty-seven valuable rules of thumb, Effective Java Programming Language Guide contains working solutions to the programming challenges most developers encounter each day. Offering comprehensive descriptions of techniques used by the experts who developed the Java platform, thisbook reveals what to do - and what not to do - in order to produce clear, robust and efficient code.

Table of Contents
Foreword ............................................................................................................................... 1 Preface................................................................................................................................... 3 Acknowledgments................................................................................................................. 4 Chapter 1. Introduction....................................................................................................... 5 Chapter 2. Creating and Destroying Objects .................................................................... 8 Item 1: Considerproviding static factory methods instead of constructors ....................... 8 Item 2: Enforce the singleton property with a private constructor................................... 11 Item 3: Enforce noninstantiability with a private constructor.......................................... 13 Item 4: Avoid creating duplicateobjects.......................................................................... 13 Item 5: Eliminate obsolete object references ................................................................... 16 Item 6: Avoid finalizers.................................................................................................... 19 Chapter 3. Methods Common to All Objects .................................................................. 23 Item 7: Obey the generalcontract when overriding equals ............................................ 23 Item 8: Always override hashCode when you override equals ...................................... 31 Item 9: Always override toString .................................................................................. 35 Item 10: Override clone judiciously............................................................................... 37 Item 11: Consider implementing Comparable ................................................................. 44 Chapter 4. Classes and Interfaces..................................................................................... 48 Item 12: Minimize the accessibility of classes and members .......................................... 48 Item 13: Favor immutability............................................................................................ 50 Item 14: Favor composition over inheritance .................................................................. 57 Item 15: Design and document for inheritance or else prohibit it.................................... 61 Item 16: Prefer interfaces to abstract classes................................................................... 65 Item 17: Use interfaces only to define types .................................................................... 69 Item 18: Favor static member classes over nonstatic ....................................................... 71 Chapter 5. Substitutes for C Constructs .......................................................................... 75 Item 19: Replace structures with...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Java Language Programming
  • Practical Artificial Intelligence Programming With Java
  • Computer Programming
  • Xtream Programming
  • Lean Programming
  • Extreme Programming
  • Dynamic Programming
  • Extreme Programming

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS